From 22132af8615a6b34328bd0f1708bbc0ccf7ebe6a Mon Sep 17 00:00:00 2001 From: Luis Presuel Date: Thu, 5 Dec 2024 11:47:54 -0600 Subject: [PATCH] adds needed migration of how tests are handled since as we are using pytest, it does not call the constructor of the super class correctly --- tests/test_pm.py | 6 ++---- tests/test_ssh.py | 3 +-- tests/test_vaas.py | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/test_pm.py b/tests/test_pm.py index 5bf37c2..d15cc62 100644 --- a/tests/test_pm.py +++ b/tests/test_pm.py @@ -97,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" @@ -165,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 0991f02..fbde9e7 100644 --- a/tests/test_ssh.py +++ b/tests/test_ssh.py @@ -82,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_vaas.py b/tests/test_vaas.py index 39ca9a8..b55fefb 100644 --- a/tests/test_vaas.py +++ b/tests/test_vaas.py @@ -30,7 +30,6 @@ 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")