Skip to content

Commit

Permalink
Add test for getting non existent person
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin5605 committed Feb 23, 2024
1 parent a3e4609 commit 61a8839
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_subscriptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import uuid
from datetime import datetime

import pytest
Expand Down Expand Up @@ -41,7 +42,7 @@ def test_create_subscription_nonexistent_package(db_session: Session):

with pytest.raises(HTTPException) as error:
create_subscription_route(payload, db_session)
assert error.value.status_code == 404
assert error.value.status_code == 404


def test_get_person(db_session: Session):
Expand All @@ -63,3 +64,12 @@ def test_get_person(db_session: Session):
assert person.discord_id == 123
assert person.email_address is None
assert person.packages == ["test-package"]


def test_get_nonexistent_person(db_session: Session):
with pytest.raises(HTTPException) as error:
# the chances of this already existing are very low
person_id = uuid.uuid4()
get_person_route(person_id=person_id, session=db_session)

assert error.value.status_code == 404

0 comments on commit 61a8839

Please sign in to comment.