Esempio n. 1
0
def test_document_status_endpoint():
    api = spec.to_dict()
    assert '/status' in api['paths']
    assert 'get' in api['paths']['/status']
    assert '200' in api['paths']['/status']['get']['responses']
    assert 'string' in api['paths']['/status']['get']['responses']['200'][
        'schema']
Esempio n. 2
0
def test_document_health_endpoint():
    api = spec.to_dict()
    assert '/health' in api['paths']
    assert 'get' in api['paths']['/health']
    assert '200' in api['paths']['/health']['get']['responses']
    assert 'string' in api['paths']['/health']['get']['responses']['200'][
        'schema']
    assert '503' in api['paths']['/health']['get']['responses']
    assert 'string' in api['paths']['/health']['get']['responses']['503'][
        'schema']
Esempio n. 3
0
def swagger():
    """
    Responds with the OpenAPI specification for this application.
    """
    return jsonify(spec.to_dict())
Esempio n. 4
0
def test_document_meta():
    api = spec.to_dict()
    assert api['info']['title'] == 'Test2'
    assert api['info']['version'] == __version__
    assert api['info']['description'] == 'My new project'