⬆ Upgrade version required of Starlette from 0.19.1 to 0.20.4 (#4820)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
Marcelo Trylesinski
2022-09-15 14:32:05 +02:00
committed by GitHub
parent 1073062c7f
commit adcf03f2bc
6 changed files with 4 additions and 25 deletions
-11
View File
@@ -4,14 +4,6 @@ from fastapi import FastAPI
from fastapi.testclient import TestClient
from pydantic import BaseModel
from .utils import needs_py37
# In Python 3.6:
# u = Union[ExtendedItem, Item] == __main__.Item
# But in Python 3.7:
# u = Union[ExtendedItem, Item] == typing.Union[__main__.ExtendedItem, __main__.Item]
app = FastAPI()
@@ -118,21 +110,18 @@ inherited_item_openapi_schema = {
}
@needs_py37
def test_inherited_item_openapi_schema():
response = client.get("/openapi.json")
assert response.status_code == 200, response.text
assert response.json() == inherited_item_openapi_schema
@needs_py37
def test_post_extended_item():
response = client.post("/items/", json={"name": "Foo", "age": 5})
assert response.status_code == 200, response.text
assert response.json() == {"item": {"name": "Foo", "age": 5}}
@needs_py37
def test_post_item():
response = client.post("/items/", json={"name": "Foo"})
assert response.status_code == 200, response.text