Skip to content

Commit

Permalink
🐛 fetch alice credentials/proofs instead of for faber/acme
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Aug 21, 2024
1 parent f1dbc17 commit d36fbde
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
17 changes: 9 additions & 8 deletions app/tests/e2e/issuer/test_get_records_paginated.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
)
async def test_get_credential_exchange_records_paginated(
faber_client: RichAsyncClient,
alice_client: RichAsyncClient,
credential_definition_id: str,
faber_and_alice_connection: FaberAliceConnect,
):
Expand Down Expand Up @@ -51,7 +52,7 @@ async def test_get_credential_exchange_records_paginated(
num_tries = 0
retry = True
while retry and num_tries < 5: # Handle case where record doesn't exist yet
response = await faber_client.get(
response = await alice_client.get(
CREDENTIALS_BASE_PATH,
params={
"state": "offer-sent",
Expand All @@ -70,10 +71,10 @@ async def test_get_credential_exchange_records_paginated(
), f"Expected {expected_num} records, got {len(credentials)}: {credentials}"

# Test offset greater than number of records
response = await faber_client.get(
response = await alice_client.get(
CREDENTIALS_BASE_PATH,
params={
"state": "offer-sent",
"state": "offer-received",
"limit": 1,
"offset": num_credentials_to_test,
},
Expand All @@ -82,12 +83,12 @@ async def test_get_credential_exchange_records_paginated(
assert len(credentials) == 0

# Test fetching unique records with pagination
prev_credentials = []
alice_prev_credentials = []
for offset in range(num_credentials_to_test):
response = await faber_client.get(
response = await alice_client.get(
CREDENTIALS_BASE_PATH,
params={
"state": "offer-sent",
"state": "offer-received",
"limit": 1,
"offset": offset,
},
Expand All @@ -97,8 +98,8 @@ async def test_get_credential_exchange_records_paginated(
assert len(credentials) == 1

record = credentials[0]
assert record not in prev_credentials
prev_credentials.append(record)
assert record not in alice_prev_credentials
alice_prev_credentials.append(record)

# Test invalid limit and offset values
invalid_params = [
Expand Down
17 changes: 9 additions & 8 deletions app/tests/e2e/verifier/test_get_records_paginated.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)
async def test_get_presentation_exchange_records_paginated(
acme_client: RichAsyncClient,
alice_client: RichAsyncClient,
credential_definition_id: str,
acme_and_alice_connection: AcmeAliceConnect,
):
Expand Down Expand Up @@ -47,10 +48,10 @@ async def test_get_presentation_exchange_records_paginated(
num_tries = 0
retry = True
while retry and num_tries < 5: # Handle case where record doesn't exist yet
response = await acme_client.get(
response = await alice_client.get(
f"{VERIFIER_BASE_PATH}/proofs",
params={
"state": "request-sent",
"state": "request-received",
"limit": limit,
},
)
Expand All @@ -66,10 +67,10 @@ async def test_get_presentation_exchange_records_paginated(
), f"Expected {expected_num} records, got {len(proofs)}: {proofs}"

# Test offset greater than number of records
response = await acme_client.get(
response = await alice_client.get(
f"{VERIFIER_BASE_PATH}/proofs",
params={
"state": "request-sent",
"state": "request-received",
"limit": 1,
"offset": num_presentation_requests_to_test,
},
Expand All @@ -78,9 +79,9 @@ async def test_get_presentation_exchange_records_paginated(
assert len(proofs) == 0

# Test fetching unique records with pagination
prev_proofs = []
alice_previous_proofs = []
for offset in range(num_presentation_requests_to_test):
response = await acme_client.get(
response = await alice_client.get(
f"{VERIFIER_BASE_PATH}/proofs",
params={
"state": "request-sent",
Expand All @@ -93,8 +94,8 @@ async def test_get_presentation_exchange_records_paginated(
assert len(proofs) == 1

record = proofs[0]
assert record not in prev_proofs
prev_proofs.append(record)
assert record not in alice_previous_proofs
alice_previous_proofs.append(record)

# Test invalid limit and offset values
invalid_params = [
Expand Down

0 comments on commit d36fbde

Please sign in to comment.