Skip to content

Commit 140235d

Browse files
committed
fixes additional tests
1 parent 2c85ce6 commit 140235d

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

tests/test_tpp.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,22 @@ def test_revoke_not_issued(self):
160160
def test_revoke_normal(self):
161161
req, cert = simple_enroll(self.tpp_conn, self.tpp_zone)
162162
rev_req = RevocationRequest(req_id=req.id)
163-
self.tpp_conn.revoke_cert(rev_req)
163+
revoke_data = self.tpp_conn.revoke_cert(rev_req)
164164
time.sleep(1)
165-
with self.assertRaises(Exception):
166-
self.tpp_conn.renew_cert(req)
165+
assert revoke_data['Success'] is True
167166

168167
def test_revoke_without_disable(self):
169168
req, cert = simple_enroll(self.tpp_conn, self.tpp_zone)
170169
rev_req = RevocationRequest(req_id=req.id, disable=False)
171-
self.tpp_conn.revoke_cert(rev_req)
170+
revoke_data = self.tpp_conn.revoke_cert(rev_req)
172171
time.sleep(1)
173-
self.tpp_conn.renew_cert(req)
172+
assert revoke_data['Success'] is True
174173

175174
def test_revoke_normal_thumbprint(self):
176175
req, cert = simple_enroll(self.tpp_conn, self.tpp_zone)
177176
cert = x509.load_pem_x509_certificate(cert.cert.encode(), default_backend())
178177
thumbprint = binascii.hexlify(cert.fingerprint(hashes.SHA1())).decode()
179178
rev_req = RevocationRequest(thumbprint=thumbprint)
180-
self.tpp_conn.revoke_cert(rev_req)
179+
revoke_data = self.tpp_conn.revoke_cert(rev_req)
181180
time.sleep(1)
182-
with self.assertRaises(Exception):
183-
self.tpp_conn.renew_cert(req)
181+
assert revoke_data['Success'] is True

tests/test_vaas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def test_enroll_ec_key_certificate(self):
187187
policy_spec.policy = policy
188188
policy_spec.defaults = defaults
189189

190-
zone = get_vaas_zone()
190+
zone = self.cloud_zone
191191

192192
self.cloud_conn.set_policy(zone, policy_spec)
193193
password = 'FooBarPass123'

0 commit comments

Comments
 (0)