diff --git a/tests/test_pm.py b/tests/test_pm.py index e54b1ee..d15cc62 100644 --- a/tests/test_pm.py +++ b/tests/test_pm.py @@ -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 @@ -98,13 +97,12 @@ def _assert_policy_spec(self, ps): class TestTPPPolicyManagement(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_PM) self.tpp_conn.get_access_token(auth) self.json_file = POLICY_SPEC_JSON self.yaml_file = POLICY_SPEC_YAML - super(TestTPPPolicyManagement, self).__init__(*args, **kwargs) prefixed_universal = None username = "osstestuser" @@ -166,11 +164,10 @@ def _create_policy_tpp(self, policy_spec=None, policy=None, defaults=None): class TestVaaSPolicyManagement(unittest.TestCase): - def __init__(self, *args, **kwargs): + def setUp(self): self.cloud_conn = CloudConnection(token=CLOUD_APIKEY, url=CLOUD_URL) self.json_file = POLICY_SPEC_JSON self.yaml_file = POLICY_SPEC_YAML - super(TestVaaSPolicyManagement, self).__init__(*args, **kwargs) def test_create_policy_from_json(self): # ps = json_parser.parse_file(self.json_file) diff --git a/tests/test_ssh.py b/tests/test_ssh.py index d357541..fbde9e7 100644 --- a/tests/test_ssh.py +++ b/tests/test_ssh.py @@ -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() @@ -83,9 +82,8 @@ def test_retrieve_ca_public_key_and_principals(self): class TestTPPSSHCertificate(unittest.TestCase): - def __init__(self, *args, **kwargs): + def setUp(self): self.tpp_conn = TPPConnection(TPP_USER, TPP_PASSWORD, TPP_URL, http_request_kwargs={'verify': "/tmp/chain.pem"}) - super(TestTPPSSHCertificate, self).__init__(*args, **kwargs) def test_retrieve_ca_public_key_and_principals(self): ssh_config = _retrieve_ssh_config(self.tpp_conn) diff --git a/tests/test_tpp.py b/tests/test_tpp.py index 5ff888b..11ffc77 100644 --- a/tests/test_tpp.py +++ b/tests/test_tpp.py @@ -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" diff --git a/tests/test_tpp_token.py b/tests/test_tpp_token.py index 54b8b8c..d97aca0 100644 --- a/tests/test_tpp_token.py +++ b/tests/test_tpp_token.py @@ -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" diff --git a/tests/test_vaas.py b/tests/test_vaas.py index 83422e6..b55fefb 100644 --- a/tests/test_vaas.py +++ b/tests/test_vaas.py @@ -30,18 +30,16 @@ from test_utils import random_word, enroll, renew, renew_by_thumbprint, renew_without_key_reuse, simple_enroll, \ get_vaas_zone from vcert import CloudConnection, KeyType, CertificateRequest, CustomField, logger, CSR_ORIGIN_SERVICE -from vcert.policy import KeyPair, DefaultKeyPair, PolicySpecification from vcert.common import RetireRequest log = logger.get_child("test-vaas") 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" diff --git a/vcert/connection_tpp_token.py b/vcert/connection_tpp_token.py index cdf940c..7985a28 100644 --- a/vcert/connection_tpp_token.py +++ b/vcert/connection_tpp_token.py @@ -30,7 +30,6 @@ KEY_REFRESH_TOKEN = 'refresh_token' # nosec KEY_EXPIRATION_DATE = 'expiration_date' - class TPPTokenConnection(AbstractTPPConnection): def __init__(self, url, user=None, password=None, access_token=None, refresh_token=None, http_request_kwargs=None): """