tests: use pytest instead of unittest

pytest provides session scoped fixtures, making it much easier
to reuse resources across tests.
This commit is contained in:
Lucian Petrut
2026-09-07 11:52:46 +00:00
parent 4ddf0c015d
commit 1e9c2816ef
15 changed files with 403 additions and 454 deletions
+9 -9
View File
@@ -3,16 +3,16 @@
"""Exercise VDDK-compatible NFC authentication against the lab vCenter."""
from tests.integration.base import TestBase
from tests.integration.base import LabEnv
class NfcAuthTest(TestBase):
def test_authd_handshake_completes(self) -> None:
class TestNfcAuth:
def test_authd_handshake_completes(self, lab: LabEnv) -> None:
"""Complete VIM login and authd PROXY through ``200 Connect``."""
with self.authenticate() as session:
with lab.authenticate() as session:
ticket = session.ticket
self.assertTrue(ticket.host)
self.assertTrue(ticket.port)
self.assertTrue(ticket.sessionId)
self.assertTrue(session.authd_sock.version())
self.assertTrue(session.authd_sock.cipher())
assert ticket.host
assert ticket.port
assert ticket.sessionId
assert session.authd_sock.version()
assert session.authd_sock.cipher()