Skip to content

Commit

Permalink
✅ update route tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Jun 27, 2024
1 parent 621680e commit 71f5f60
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/tests/routes/connections/test_get_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
{"state": "active"},
{"my_did": "my_did"},
{"their_did": "their_did"},
{"alias": "test_alias", "their_public_did": "their_public_did"},
{"alias": "test_alias", "their_public_did": "their_public_did", "limit": 10},
{"limit": 5, "offset": 5},
],
)
async def test_get_connections_success(params):
Expand All @@ -52,11 +53,19 @@ async def test_get_connections_success(params):
mock_aries_controller
)

# to fix Query objects not being comparable to expected
if "limit" not in params:
params["limit"] = 100
if "offset" not in params:
params["offset"] = 0

response = await get_connections(auth="mocked_auth", **params)

assert response == connections_response.results

expected_params = {
"limit": params.get("limit") or 100,
"offset": params.get("offset") or 0,
"alias": params.get("alias"),
"connection_protocol": params.get("connection_protocol"),
"invitation_key": params.get("invitation_key"),
Expand Down

0 comments on commit 71f5f60

Please sign in to comment.