Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of send_credential_ack #1653

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ async def send_credential_ack(
Delete credential exchange record if set to auto-remove.

Returns:
Tuple: cred ex record, credential ack message for tracing.
credential ack message for tracing

"""
credential_ack_message = CredentialAck()
Expand Down
7 changes: 3 additions & 4 deletions aries_cloudagent/protocols/issue_credential/v1_0/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,10 +1183,9 @@ async def credential_exchange_store(request: web.BaseRequest):
)

try: # protocol owes an ack
(
cred_ex_record,
credential_ack_message,
) = await credential_manager.send_credential_ack(cred_ex_record)
credential_ack_message = await credential_manager.send_credential_ack(
cred_ex_record
)
result = cred_ex_record.serialize() # pick up state done

except (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,7 @@ async def test_credential_exchange_store(self):
mock_cred_ex_record
)
mock_credential_manager.return_value.send_credential_ack.return_value = (
mock_cred_ex_record,
async_mock.MagicMock(),
async_mock.MagicMock()
)

await test_module.credential_exchange_store(self.request)
Expand Down Expand Up @@ -1224,8 +1223,7 @@ async def test_credential_exchange_store_bad_cred_id_json(self):
mock_cred_ex_record
)
mock_credential_manager.return_value.send_credential_ack.return_value = (
mock_cred_ex_record,
async_mock.MagicMock(),
async_mock.MagicMock()
)

await test_module.credential_exchange_store(self.request)
Expand Down Expand Up @@ -1278,8 +1276,7 @@ async def test_credential_exchange_store_no_conn_record(self):
mock_cred_ex
)
mock_credential_manager.return_value.send_credential_ack.return_value = (
mock_cred_ex,
async_mock.MagicMock(),
async_mock.MagicMock()
)

with self.assertRaises(test_module.web.HTTPBadRequest):
Expand Down Expand Up @@ -1339,10 +1336,7 @@ async def test_credential_exchange_store_x(self):
return_value=mock_cred_ex_record
),
send_credential_ack=async_mock.CoroutineMock(
return_value=(
mock_cred_ex_record,
async_mock.MagicMock(),
)
return_value=async_mock.MagicMock()
),
)

Expand Down