mirror of https://github.com/tiangolo/fastapi.git
✏️ Fix typos in data for tests (#4958)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
2f048f7199
commit
b4b39d3359
|
|
@ -33,7 +33,7 @@ async def hidden_query(
|
||||||
return {"hidden_query": hidden_query}
|
return {"hidden_query": hidden_query}
|
||||||
|
|
||||||
|
|
||||||
openapi_shema = {
|
openapi_schema = {
|
||||||
"openapi": "3.0.2",
|
"openapi": "3.0.2",
|
||||||
"info": {"title": "FastAPI", "version": "0.1.0"},
|
"info": {"title": "FastAPI", "version": "0.1.0"},
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|
@ -162,7 +162,7 @@ def test_openapi_schema():
|
||||||
client = TestClient(app)
|
client = TestClient(app)
|
||||||
response = client.get("/openapi.json")
|
response = client.get("/openapi.json")
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert response.json() == openapi_shema
|
assert response.json() == openapi_schema
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ def examples(
|
||||||
@app.post("/example_examples/")
|
@app.post("/example_examples/")
|
||||||
def example_examples(
|
def example_examples(
|
||||||
item: Item = Body(
|
item: Item = Body(
|
||||||
example={"data": "Overriden example"},
|
example={"data": "Overridden example"},
|
||||||
examples={
|
examples={
|
||||||
"example1": {"value": {"data": "examples example_examples 1"}},
|
"example1": {"value": {"data": "examples example_examples 1"}},
|
||||||
"example2": {"value": {"data": "examples example_examples 2"}},
|
"example2": {"value": {"data": "examples example_examples 2"}},
|
||||||
|
|
@ -76,7 +76,7 @@ def example_examples(
|
||||||
# def form_example_examples(
|
# def form_example_examples(
|
||||||
# lastname: str = Form(
|
# lastname: str = Form(
|
||||||
# ...,
|
# ...,
|
||||||
# example="Doe overriden",
|
# example="Doe overridden",
|
||||||
# examples={
|
# examples={
|
||||||
# "example1": {"summary": "last name summary", "value": "Doe"},
|
# "example1": {"summary": "last name summary", "value": "Doe"},
|
||||||
# "example2": {"value": "Doesn't"},
|
# "example2": {"value": "Doesn't"},
|
||||||
|
|
@ -110,7 +110,7 @@ def path_examples(
|
||||||
@app.get("/path_example_examples/{item_id}")
|
@app.get("/path_example_examples/{item_id}")
|
||||||
def path_example_examples(
|
def path_example_examples(
|
||||||
item_id: str = Path(
|
item_id: str = Path(
|
||||||
example="item_overriden",
|
example="item_overridden",
|
||||||
examples={
|
examples={
|
||||||
"example1": {"summary": "item ID summary", "value": "item_1"},
|
"example1": {"summary": "item ID summary", "value": "item_1"},
|
||||||
"example2": {"value": "item_2"},
|
"example2": {"value": "item_2"},
|
||||||
|
|
@ -147,7 +147,7 @@ def query_examples(
|
||||||
def query_example_examples(
|
def query_example_examples(
|
||||||
data: Union[str, None] = Query(
|
data: Union[str, None] = Query(
|
||||||
default=None,
|
default=None,
|
||||||
example="query_overriden",
|
example="query_overridden",
|
||||||
examples={
|
examples={
|
||||||
"example1": {"summary": "Query example 1", "value": "query1"},
|
"example1": {"summary": "Query example 1", "value": "query1"},
|
||||||
"example2": {"value": "query2"},
|
"example2": {"value": "query2"},
|
||||||
|
|
@ -184,7 +184,7 @@ def header_examples(
|
||||||
def header_example_examples(
|
def header_example_examples(
|
||||||
data: Union[str, None] = Header(
|
data: Union[str, None] = Header(
|
||||||
default=None,
|
default=None,
|
||||||
example="header_overriden",
|
example="header_overridden",
|
||||||
examples={
|
examples={
|
||||||
"example1": {"summary": "Query example 1", "value": "header1"},
|
"example1": {"summary": "Query example 1", "value": "header1"},
|
||||||
"example2": {"value": "header2"},
|
"example2": {"value": "header2"},
|
||||||
|
|
@ -221,7 +221,7 @@ def cookie_examples(
|
||||||
def cookie_example_examples(
|
def cookie_example_examples(
|
||||||
data: Union[str, None] = Cookie(
|
data: Union[str, None] = Cookie(
|
||||||
default=None,
|
default=None,
|
||||||
example="cookie_overriden",
|
example="cookie_overridden",
|
||||||
examples={
|
examples={
|
||||||
"example1": {"summary": "Query example 1", "value": "cookie1"},
|
"example1": {"summary": "Query example 1", "value": "cookie1"},
|
||||||
"example2": {"value": "cookie2"},
|
"example2": {"value": "cookie2"},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue