mirror of https://github.com/tiangolo/fastapi.git
add test for full coverage
Signed-off-by: merlinz01 <158784988+merlinz01@users.noreply.github.com>
This commit is contained in:
parent
78b49ac9ae
commit
96d2ca4426
|
|
@ -71,6 +71,10 @@ def test_apis(api):
|
|||
|
||||
|
||||
def test_required_field():
|
||||
response = client.post("/api5", json={"integer": 100})
|
||||
assert response.status_code == 200, response.text
|
||||
assert response.json() == {"received": 100}
|
||||
|
||||
response = client.post("/api5", json={"integer": None})
|
||||
assert response.status_code == 422, response.text
|
||||
assert response.json() == IsDict(
|
||||
|
|
|
|||
Loading…
Reference in New Issue