Last active
June 29, 2024 19:12
-
-
Save 5t33/c50aafc13f5abcb32dff3c6ca51ba6bd to your computer and use it in GitHub Desktop.
test_server.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .server import app | |
def test_validates_book_no_genre(): | |
book = { | |
"title": "Cat In The Hat", | |
"genre": "Historical Fiction" | |
} | |
result = app.test_client().post( | |
"/book", | |
json=book, | |
headers={ | |
'Content-type':'application/json', | |
} | |
) | |
assert result.status_code == 400 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment