Skip to content

Commit

Permalink
fix: make integration test less brittle
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerburdsall committed Apr 22, 2022
1 parent 5085066 commit e44259f
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions tests/test_momento_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,12 @@ async def test_list_caches_with_next_token_works(self):

# signing keys
async def test_create_list_revoke_signing_keys(self):
try:
create_resp = await self.client.create_signing_key(30)
list_resp = await self.client.list_signing_keys()
self.assertTrue(0 < len(list_resp.signing_keys()))
signing_key = list_resp.signing_keys()[0]
self.assertEqual(create_resp.endpoint(), signing_key.endpoint())
self.assertEqual(create_resp.key_id(), signing_key.key_id())
finally:
list_resp = await self.client.list_signing_keys()
for signing_key in list_resp.signing_keys():
await self.client.revoke_signing_key(signing_key.key_id())
create_resp = await self.client.create_signing_key(30)
list_resp = await self.client.list_signing_keys()
self.assertTrue(create_resp.key_id() in [signing_key.key_id() for signing_key in list_resp.signing_keys()])
await self.client.revoke_signing_key(create_resp.key_id())
list_resp = await self.client.list_signing_keys()
self.assertEqual(0, len(list_resp.signing_keys()))
self.assertFalse(create_resp.key_id() in [signing_key.key_id() for signing_key in list_resp.signing_keys()])

# setting and getting

Expand Down

0 comments on commit e44259f

Please sign in to comment.