flask-demo-api/tests/test_get.py

15 lines
418 B
Python

def test_get_without_args(client):
response = client.get("/")
assert response.status_code == 400
assert response.get_json() == {
"error": "400 Bad Request: Invalid GET parameters",
}
def test_get_with_wrong_key(client):
response = client.get("/?key=blabla")
assert response.status_code == 404
assert response.get_json() == {
"error": "404 Not Found: Key not found",
}