Skip to content

Commit

Permalink
✅ fix did_peer_2 and _4 tests missing return_value of didinfo
Browse files Browse the repository at this point in the history
Signed-off-by: ff137 <ff137@proton.me>
  • Loading branch information
ff137 committed Feb 2, 2024
1 parent b4dce3b commit 405e6e2
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions aries_cloudagent/protocols/didexchange/v1_0/tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from .....storage.error import StorageNotFoundError
from .....transport.inbound.receipt import MessageReceipt
from .....wallet.did_info import DIDInfo
from .....wallet.did_method import PEER2, SOV, DIDMethods
from .....wallet.did_method import PEER2, PEER4, SOV, DIDMethods
from .....wallet.error import WalletError
from .....wallet.in_memory import InMemoryWallet
from .....wallet.key_type import ED25519
Expand Down Expand Up @@ -554,11 +554,20 @@ async def test_create_request_emit_did_peer_2(self):
my_did=None,
save=mock.CoroutineMock(),
)
mock_did_info = DIDInfo(
TestConfig.test_did_peer_2,
TestConfig.test_verkey,
None,
method=PEER2,
key_type=ED25519,
)

self.profile.context.update_settings({"emit_did_peer_2": True})

with mock.patch.object(
self.manager, "create_did_peer_2", mock.AsyncMock()
self.manager,
"create_did_peer_2",
mock.AsyncMock(return_value=mock_did_info),
) as mock_create_did_peer_2:
request = await self.manager.create_request(
mock_conn_rec, use_public_did=True
Expand All @@ -577,11 +586,18 @@ async def test_create_request_emit_did_peer_4(self):
my_did=None,
save=mock.CoroutineMock(),
)
mock_did_info = DIDInfo(
TestConfig.test_did_peer_4,
TestConfig.test_verkey,
None,
method=PEER4,
key_type=ED25519,
)

self.profile.context.update_settings({"emit_did_peer_4": True})

with mock.patch.object(
self.manager, "create_did_peer_4", mock.AsyncMock()
self.manager, "create_did_peer_4", mock.AsyncMock(return_value=mock_did_info)
) as mock_create_did_peer_4:
request = await self.manager.create_request(
mock_conn_rec, use_public_did=True
Expand Down Expand Up @@ -1702,7 +1718,7 @@ async def test_create_response_inkind_peer_did_4(self):
TestConfig.test_did_peer_4,
TestConfig.test_verkey,
None,
method=PEER2,
method=PEER4,
key_type=ED25519,
)
response = await self.manager.create_response(
Expand Down

0 comments on commit 405e6e2

Please sign in to comment.