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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user