Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
feat: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Mar 19, 2024
1 parent 25dc156 commit ccaf7bf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@
class TestMain(TestCase):
client = TestClient(app)

def test_user_create_and_delete(self):
"""
Create a user and then delete it.
"""
future_user = {
"first_name": "Parham",
"last_name": "Alvani",
"average": 18.0,
}

response = self.client.post(
"/users",
json=future_user,
)
assert response.status_code == 200
user = response.json()
assert future_user.items() <= user.items()

response = self.client.delete(f"/users/{user['id']}")
assert response.status_code == 200

def test_users_create_and_list(self):
"""
Create valid users and make sure it returns in the users list.
Expand Down

0 comments on commit ccaf7bf

Please sign in to comment.