From 278564f6e08117ed63cc379066d4864a0501bbe1 Mon Sep 17 00:00:00 2001 From: PeterStrob Date: Wed, 3 Nov 2021 14:08:21 -0700 Subject: [PATCH] fix:updated test_events and test_holder tests, added flag to docker-compose.yml file Signed-off-by: PeterStrob --- int/docker-compose.yml | 2 +- int/tests/test_holder.py | 14 +++----------- tests/holder/test_events.py | 6 +++++- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/int/docker-compose.yml b/int/docker-compose.yml index 7d991f63..f9053eb8 100644 --- a/int/docker-compose.yml +++ b/int/docker-compose.yml @@ -18,7 +18,7 @@ services: ACAPY_TOOLBOX_LOG_LEVEL: DEBUG ports: - "3001:3001" - command: start -it http 0.0.0.0 3000 -ot http -e http://acapy_plugin_agent:3000 --admin 0.0.0.0 3001 --admin-insecure-mode --plugin acapy_plugin_toolbox --genesis-url https://raw.githubusercontent.com/Indicio-tech/indicio-network/master/genesis_files/pool_transactions_testnet_genesis --wallet-type indy --wallet-name default --wallet-key "insecure, for use in testing only" --auto-provision --auto-ping-connection --monitor-ping --auto-store-credential + command: start -it http 0.0.0.0 3000 -ot http -e http://acapy_plugin_agent:3000 --admin 0.0.0.0 3001 --admin-insecure-mode --plugin acapy_plugin_toolbox --genesis-url https://raw.githubusercontent.com/Indicio-tech/indicio-network/master/genesis_files/pool_transactions_testnet_genesis --wallet-type indy --wallet-name default --wallet-key "insecure, for use in testing only" --auto-provision --auto-ping-connection --monitor-ping --auto-store-credential --preserve-exchange-records echo: image: echo-agent diff --git a/int/tests/test_holder.py b/int/tests/test_holder.py index a304271e..140b1fb3 100644 --- a/int/tests/test_holder.py +++ b/int/tests/test_holder.py @@ -166,28 +166,20 @@ async def test_holder_credential_exchange( async def test_credentials_get_list( backchannel: Client, connection, - issuer_holder_connection, - endorser_did, - create_schema, - create_cred_def, issue_credential, ): - cred1 = issue_credential - cred2 = issue_credential + cred = issue_credential credentials_get_list = await connection.send_and_await_reply_async( { "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/admin-holder/0.1/credentials-get-list" } ) - cred1_set = set([result.credential_exchange_id for result in cred1.results]) - cred2_set = set([result.credential_exchange_id for result in cred2.results]) + cred_set = set([result.credential_exchange_id for result in cred.results]) cred_get_list_set = set( [cred["credential_exchange_id"] for cred in credentials_get_list["results"]] ) - assert ( credentials_get_list["@type"] == "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/admin-holder/0.1/credentials-list" ) - assert cred1_set.issubset(cred_get_list_set) - assert cred2_set.issubset(cred_get_list_set) + assert cred_set.issubset(cred_get_list_set) diff --git a/tests/holder/test_events.py b/tests/holder/test_events.py index 10ff7eff..bd791274 100644 --- a/tests/holder/test_events.py +++ b/tests/holder/test_events.py @@ -2,6 +2,8 @@ # pylint: disable=redefined-outer-name +import typing + import pytest from acapy_plugin_toolbox.holder import v0_1 as test_module from aries_cloudagent.core.event_bus import Event, EventBus @@ -120,7 +122,9 @@ async def test_pres_req_received_sent_on_state(profile, mock_send_to_admins): handler = test_module.present_proof_event_handler state = V10PresentationExchange.STATE_REQUEST_RECEIVED message = test_module.PresRequestReceived - event = Event("anything", {"state": state}) + event = Event( + "anything", {"state": state, "presentation_request": {"pres_request": "test"}} + ) with mock.patch.object( message, "retrieve_matching_credentials", mock.CoroutineMock() ):