Skip to content

Commit

Permalink
fixes convention to use pytest style, as currently our tests runs on …
Browse files Browse the repository at this point in the history
…it rather than unittest.Testcase. To be noted that Pytest doesn't follow the same initialization mechanisms as unittest library
  • Loading branch information
luispresuelVenafi committed Dec 4, 2024
1 parent b9e7c83 commit 971b5fc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions tests/test_pm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@


class TestParsers(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestParsers, self).__init__(*args, **kwargs)
def setUp(self):
self.json_file = POLICY_SPEC_JSON
self.yaml_file = POLICY_SPEC_YAML

Expand Down
3 changes: 1 addition & 2 deletions tests/test_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@


class TestTPPTokenSSHCertificate(unittest.TestCase):
def __init__(self, *args, **kwargs):
def setUp(self):
self.tpp_conn = TPPTokenConnection(url=TPP_TOKEN_URL, http_request_kwargs={'verify': "/tmp/chain.pem"})
auth = Authentication(user=TPP_USER, password=TPP_PASSWORD, scope=SCOPE_SSH)
self.tpp_conn.get_access_token(auth)
super(TestTPPTokenSSHCertificate, self).__init__(*args, **kwargs)

def test_enroll_local_generated_keypair(self):
keypair = SSHKeyPair()
Expand Down
3 changes: 1 addition & 2 deletions tests/test_tpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ def test_fake_enroll(self):


class TestTPPMethods(unittest.TestCase):
def __init__(self, *args, **kwargs):
def setUp(self):
self.tpp_zone = TPP_ZONE
self.tpp_zone_ecdsa = TPP_ZONE_ECDSA
self.tpp_conn = TPPConnection(TPP_USER, TPP_PASSWORD, TPP_URL, http_request_kwargs={'verify': "/tmp/chain.pem"})
super(TestTPPMethods, self).__init__(*args, **kwargs)

def test_tpp_enroll(self):
cn = f"{random_word(10)}.venafi.example.com"
Expand Down
3 changes: 1 addition & 2 deletions tests/test_tpp_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@


class TestTPPTokenMethods(unittest.TestCase):
def __init__(self, *args, **kwargs):
def setUp(self):
self.tpp_zone = TPP_ZONE
self.tpp_zone_ecdsa = TPP_ZONE_ECDSA
self.tpp_conn = TPPTokenConnection(url=TPP_TOKEN_URL, user=TPP_USER, password=TPP_PASSWORD,
http_request_kwargs={'verify': "/tmp/chain.pem"})
super(TestTPPTokenMethods, self).__init__(*args, **kwargs)

def test_tpp_token_enroll(self):
cn = f"{random_word(10)}.venafi.example.com"
Expand Down
3 changes: 1 addition & 2 deletions tests/test_vaas.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@


class TestVaaSMethods(unittest.TestCase):
def __init__(self, *args, **kwargs):
def setUp(self):
self.cloud_zone = CLOUD_ZONE
self.vaas_zone_ec = VAAS_ZONE_ONLY_EC
self.cloud_conn = CloudConnection(token=CLOUD_APIKEY, url=CLOUD_URL)
super(TestVaaSMethods, self).__init__(*args, **kwargs)

def test_cloud_enroll(self):
cn = f"{random_word(10)}.venafi.example.com"
Expand Down

0 comments on commit 971b5fc

Please sign in to comment.