Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
fix:updated test_events and test_holder tests, added flag to docker-c…
Browse files Browse the repository at this point in the history
…ompose.yml file

Signed-off-by: PeterStrob <peter@indicio.tech>
  • Loading branch information
PeterStrob committed Nov 3, 2021
1 parent 34577b3 commit 278564f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion int/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 3 additions & 11 deletions int/tests/test_holder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 5 additions & 1 deletion tests/holder/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
):
Expand Down

0 comments on commit 278564f

Please sign in to comment.