Browse Source

Refactor OpenAPI tests to use latest JSON Schema

pull/14953/head
Sebastián Ramírez 5 months ago
parent
commit
3bc19fb29e
  1. 2
      tests/test_tutorial/test_request_files/test_tutorial001.py
  2. 5
      tests/test_tutorial/test_request_files/test_tutorial001_02.py
  3. 2
      tests/test_tutorial/test_request_files/test_tutorial001_03.py
  4. 5
      tests/test_tutorial/test_request_files/test_tutorial002.py
  5. 5
      tests/test_tutorial/test_request_files/test_tutorial003.py
  6. 2
      tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

2
tests/test_tutorial/test_request_files/test_tutorial001.py

@ -175,7 +175,7 @@ def test_openapi_schema(client: TestClient):
"file": {
"title": "File",
"type": "string",
"format": "binary",
"contentMediaType": "application/octet-stream",
}
},
},

5
tests/test_tutorial/test_request_files/test_tutorial001_02.py

@ -134,7 +134,10 @@ def test_openapi_schema(client: TestClient):
"file": {
"title": "File",
"anyOf": [
{"type": "string", "format": "binary"},
{
"type": "string",
"contentMediaType": "application/octet-stream",
},
{"type": "null"},
],
}

2
tests/test_tutorial/test_request_files/test_tutorial001_03.py

@ -123,7 +123,7 @@ def test_openapi_schema(client: TestClient):
"title": "File",
"type": "string",
"description": "A file read as bytes",
"format": "binary",
"contentMediaType": "application/octet-stream",
}
},
},

5
tests/test_tutorial/test_request_files/test_tutorial002.py

@ -210,7 +210,10 @@ def test_openapi_schema(client: TestClient):
"files": {
"title": "Files",
"type": "array",
"items": {"type": "string", "format": "binary"},
"items": {
"type": "string",
"contentMediaType": "application/octet-stream",
},
}
},
},

5
tests/test_tutorial/test_request_files/test_tutorial003.py

@ -165,7 +165,10 @@ def test_openapi_schema(client: TestClient):
"files": {
"title": "Files",
"type": "array",
"items": {"type": "string", "format": "binary"},
"items": {
"type": "string",
"contentMediaType": "application/octet-stream",
},
"description": "Multiple files as bytes",
}
},

2
tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

@ -198,7 +198,7 @@ def test_openapi_schema(client: TestClient):
"file": {
"title": "File",
"type": "string",
"format": "binary",
"contentMediaType": "application/octet-stream",
},
"fileb": {
"title": "Fileb",

Loading…
Cancel
Save