Exemplo 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']
Exemplo 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']
Exemplo n.º 3
0
def test_document_meta():
    api = spec.to_dict()
    assert api['info']['title'] == 'atomistFlaskOne'
    assert api['info']['version'] == __version__
    assert api['info']['description'] == 'My new project'
Exemplo n.º 4
0
def test_document_atomistflaskone_endpoint():
    api = spec.to_dict()
    assert '/' in api['paths']
    assert 'get' in api['paths']['/']
    assert '200' in api['paths']['/']['get']['responses']
    assert 'string' in api['paths']['/']['get']['responses']['200']['schema']
Exemplo n.º 5
0
def swagger():
    """
    Responds with the OpenAPI specification for this application.
    """
    return jsonify(spec.to_dict())