Skip to content

Commit

Permalink
adds needed migration of how tests are handled since as we are using …
Browse files Browse the repository at this point in the history
…pytest, it does not call the constructor of the super class correctly
  • Loading branch information
luispresuelVenafi committed Dec 5, 2024
1 parent 971b5fc commit 22132af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions tests/test_pm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion tests/test_vaas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 22132af

Please sign in to comment.