✅ Add tests for metadata

This commit is contained in:
Sebastián Ramírez committed 2018-12-22 18:47:05 +04:00
1 parent 4c51bb6714
commit 6b9931f882
8 files changed
+123 -3

No files matched your search

Whitespace-only changes.
@@ -0,0 +1,34 @@
from starlette.testclient import TestClient
from application_configuration.tutorial001 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {
"title": "My Super Project",
"version": "2.5.0",
"description": "This is a very fancy project, with auto docs for the API and everything",
},
"paths": {
"/items/": {
"get": {
"responses": {
"200": {
"description": "Successful Response",
"content": {"application/json": {"schema": {}}},
}
},
"summary": "Read Items Get",
"operationId": "read_items_items__get",
}
}
},
}
def test_openapi_scheme():
response = client.get("/openapi.json")
assert response.status_code == 200
assert response.json() == openapi_schema