Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
devksingh4 committed Aug 4, 2024
1 parent 699767c commit dad9196
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/live_integration/test_checkMembership.py
Original file line number Diff line number Diff line change
@@ -2,11 +2,18 @@ def test_valid_member(api_client):
response = api_client.get("/api/v1/checkMembership?netId=dsingh14")
assert response.status_code == 200
assert response.json() == {"netId": "dsingh14", "isPaidMember": True}
assert response.headers['x-acm-membership-source'] # it should at least exist, may or may not be cached
response = api_client.get("/api/v1/checkMembership?netId=dsingh14")
assert response.status_code == 200
assert response.json() == {"netId": "dsingh14", "isPaidMember": True}
assert response.headers['x-acm-membership-source'] == 'dynamo'

def test_invalid_member(api_client):
response = api_client.get("/api/v1/checkMembership?netId=invalid")
assert response.status_code == 200
assert response.json() == {"netId": "invalid", "isPaidMember": False,}
assert response.headers['x-acm-membership-source'] == 'aad' # non-member results should always be double checked against aad


def test_invalid_parameters(api_client):
response = api_client.get("/api/v1/checkMembership")

0 comments on commit dad9196

Please sign in to comment.