[tests] fix for schema lists
This commit is contained in:
parent
d5f39a7929
commit
048c9f1bab
@ -75,12 +75,14 @@ class TestDomain(TestCase):
|
|||||||
client = TestClient(halfapi.application)
|
client = TestClient(halfapi.application)
|
||||||
r = client.get('/')
|
r = client.get('/')
|
||||||
assert r.status_code == 200
|
assert r.status_code == 200
|
||||||
d_r = r.json()
|
schemas = r.json()
|
||||||
assert isinstance(d_r, dict)
|
assert isinstance(schemas, list)
|
||||||
assert 'openapi' in d_r
|
for schema in schemas:
|
||||||
assert 'info' in d_r
|
assert isinstance(schema, dict)
|
||||||
assert 'paths' in d_r
|
assert 'openapi' in schema
|
||||||
assert 'domain' in d_r
|
assert 'info' in schema
|
||||||
|
assert 'paths' in schema
|
||||||
|
assert 'domain' in schema
|
||||||
|
|
||||||
r = client.get('/halfapi/acls')
|
r = client.get('/halfapi/acls')
|
||||||
assert r.status_code == 200
|
assert r.status_code == 200
|
||||||
|
@ -26,9 +26,11 @@ def test_routes(application_debug):
|
|||||||
r = c.get('/halfapi/error/500')
|
r = c.get('/halfapi/error/500')
|
||||||
assert r.status_code == 500
|
assert r.status_code == 500
|
||||||
r = c.get('/')
|
r = c.get('/')
|
||||||
d_r = r.json()
|
schemas = r.json()
|
||||||
assert isinstance(d_r, dict)
|
assert isinstance(schemas, list)
|
||||||
assert API_SCHEMA.validate(d_r)
|
for schema in schemas:
|
||||||
|
assert isinstance(schema, dict)
|
||||||
|
assert API_SCHEMA.validate(schema)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
TODO: Find a way to test exception raising
|
TODO: Find a way to test exception raising
|
||||||
|
Loading…
Reference in New Issue
Block a user