Exemple #1
0
def test_get_resource_listing_default():
    schema_dir = 'tests/sample_schemas/good_app/'
    resource_listing = get_resource_listing(schema_dir, False)

    with open(os.path.join(schema_dir, 'api_docs.json')) as fh:
        assert resource_listing == simplejson.load(fh)
Exemple #2
0
def test_get_resource_listing_generated(mock_load, mock_generate):
    schema_dir = '/api_docs'
    resource_listing = get_resource_listing(schema_dir, True)
    mock_generate.assert_called_once_with(schema_dir, mock_load.return_value)
    assert resource_listing == mock_generate.return_value
def test_get_resource_listing_default():
    schema_dir = 'tests/sample_schemas/good_app/'
    resource_listing = get_resource_listing(schema_dir, False)

    with open(os.path.join(schema_dir, 'api_docs.json')) as fh:
        assert resource_listing == simplejson.load(fh)
Exemple #4
0
def get_swagger_schema(schema_dir='tests/sample_schemas/good_app/'):
    return compile_swagger_schema(
        schema_dir,
        get_resource_listing(schema_dir, False)
    )
def test_get_resource_listing_generated(mock_load, mock_generate):
    schema_dir = '/api_docs'
    resource_listing = get_resource_listing(schema_dir, True)
    mock_generate.assert_called_once_with(schema_dir, mock_load.return_value)
    assert resource_listing == mock_generate.return_value