Skip to content

Commit

Permalink
Update unit test
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <[email protected]>
  • Loading branch information
jamshale committed Nov 21, 2024
1 parent 5ec73ac commit 8a3ad2e
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions acapy_agent/anoncreds/tests/test_revocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,21 +836,40 @@ def test_generate_public_tails_uri(self):

async def test_upload_tails_file(self):
self.profile.inject_or = mock.Mock(
return_value=mock.MagicMock(
upload_tails_file=mock.CoroutineMock(
side_effect=[
(True, "http://tails-server.com"),
(None, "http://tails-server.com"),
(True, "not-http://tails-server.com"),
]
)
)
side_effect=[
None,
mock.MagicMock(
upload_tails_file=mock.CoroutineMock(
return_value=(True, "http://tails-server.com")
)
),
]
)
# valid
await self.revocation.upload_tails_file(rev_reg_def)
# upload fails
self.profile.inject_or = mock.Mock(
side_effect=[
None,
mock.MagicMock(
upload_tails_file=mock.CoroutineMock(
return_value=(None, "http://tails-server.com"),
)
),
]
)
with self.assertRaises(test_module.AnonCredsRevocationError):
await self.revocation.upload_tails_file(rev_reg_def)
self.profile.inject_or = mock.Mock(
side_effect=[
None,
mock.MagicMock(
upload_tails_file=mock.CoroutineMock(
return_value=(True, "not-http://tails-server.com"),
)
),
]
)
# tails location does not match
with self.assertRaises(test_module.AnonCredsRevocationError):
await self.revocation.upload_tails_file(rev_reg_def)
Expand Down

0 comments on commit 8a3ad2e

Please sign in to comment.