Skip to content

Commit

Permalink
🎨 fix assertion error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Aug 21, 2024
1 parent 315e95e commit f1dbc17
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions app/tests/e2e/issuer/test_get_records_paginated.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ async def test_get_credential_exchange_records_paginated(
},
)
credentials = response.json()
if len(credentials) != min(limit, num_credentials_to_test):
expected_num = min(limit, num_credentials_to_test)
if len(credentials) != expected_num:
num_tries += 1
await asyncio.sleep(0.2)
else:
retry = False
assert (
not retry
), f"Expected {limit} records, got {len(credentials)}: {credentials}"
), f"Expected {expected_num} records, got {len(credentials)}: {credentials}"

# Test offset greater than number of records
response = await faber_client.get(
Expand Down
5 changes: 3 additions & 2 deletions app/tests/e2e/test_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,15 @@ async def test_get_connections_paginated(
)

connections = response.json()
if len(connections) != min(limit, num_connections_to_test):
expected_num = min(limit, num_connections_to_test)
if len(connections) != expected_num:
num_tries += 1
await asyncio.sleep(0.2)
else:
retry = False
assert (
not retry
), f"Expected {limit} records, got {len(connections)}: {connections}"
), f"Expected {expected_num} records, got {len(connections)}: {connections}"

# Test offset greater than number of records
response = await alice_member_client.get(
Expand Down
7 changes: 5 additions & 2 deletions app/tests/e2e/verifier/test_get_records_paginated.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ async def test_get_presentation_exchange_records_paginated(
},
)
proofs = response.json()
if len(proofs) != min(limit, num_presentation_requests_to_test):
expected_num = min(limit, num_presentation_requests_to_test)
if len(proofs) != expected_num:
num_tries += 1
await asyncio.sleep(0.2)
else:
retry = False
assert not retry, f"Expected {limit} records, got {len(proofs)}: {proofs}"
assert (
not retry
), f"Expected {expected_num} records, got {len(proofs)}: {proofs}"

# Test offset greater than number of records
response = await acme_client.get(
Expand Down

0 comments on commit f1dbc17

Please sign in to comment.