Skip to content

Commit

Permalink
test: update_routing_keys called when configured
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <dbluhm@pm.me>
  • Loading branch information
dbluhm committed Sep 21, 2023
1 parent de7f70c commit eb331d8
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions aries_cloudagent/commands/tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,3 +690,42 @@ async def test_update_routing_keys(self):

for record in route_records:
assert record.recipient_key == TEST_VERKEY

async def test_update_routing_keys_called_from_executables(self):
version_storage_record = await self.storage.find_record(
type_filter="acapy_version", tag_query={}
)
await self.storage.delete_record(version_storage_record)
with async_mock.patch.object(
test_module,
"wallet_config",
async_mock.CoroutineMock(
return_value=(
self.profile,
async_mock.CoroutineMock(did="public DID", verkey="verkey"),
)
),
), async_mock.patch.object(
test_module.yaml,
"safe_load",
async_mock.MagicMock(
return_value={
"v0.11.0": {
"update_routing_keys": True,
},
}
),
), async_mock.patch.object(
test_module,
"update_routing_keys",
async_mock.CoroutineMock(),
) as mock_update_routing_keys:
test_module.UPGRADE_EXISTING_RECORDS_FUNCTION_MAPPING[
"update_routing_keys"
] = mock_update_routing_keys
await test_module.upgrade(
settings={
"upgrade.from_version": "v0.7.2",
}
)
mock_update_routing_keys.assert_called_once()

0 comments on commit eb331d8

Please sign in to comment.