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": { "file": {
"title": "File", "title": "File",
"type": "string", "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": { "file": {
"title": "File", "title": "File",
"anyOf": [ "anyOf": [
{"type": "string", "format": "binary"}, {
"type": "string",
"contentMediaType": "application/octet-stream",
},
{"type": "null"}, {"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", "title": "File",
"type": "string", "type": "string",
"description": "A file read as bytes", "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": { "files": {
"title": "Files", "title": "Files",
"type": "array", "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": { "files": {
"title": "Files", "title": "Files",
"type": "array", "type": "array",
"items": {"type": "string", "format": "binary"}, "items": {
"type": "string",
"contentMediaType": "application/octet-stream",
},
"description": "Multiple files as bytes", "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": { "file": {
"title": "File", "title": "File",
"type": "string", "type": "string",
"format": "binary", "contentMediaType": "application/octet-stream",
}, },
"fileb": { "fileb": {
"title": "Fileb", "title": "Fileb",

Loading…
Cancel
Save