Skip to content

Commit

Permalink
indices ending with slash
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirek Simek committed Oct 4, 2020
1 parent 4bb697f commit ae0b595
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ API for UI in OAREPO

This library provides a set of APIs for writing oarepo javascript UI client.

### ``https://localhost:5000/api/oarepo/indices?ln=<lang>``
### ``https://localhost:5000/api/oarepo/indices/?ln=<lang>``

Returns known facets of all mappings registered in ``RECORDS_REST_FACETS``

Expand Down
2 changes: 1 addition & 1 deletion oarepo_ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)


@blueprint.route('/indices')
@blueprint.route('/indices/')
def list_indices():
indices = {
index: current_oarepo_ui.get_index(index)
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def app(request):
assert subprocess.call([
'pybabel', 'compile', '-d', 'tests/translations/'
]) == 0


instance_path = tempfile.mkdtemp()
app = Flask('testapp', instance_path=instance_path)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def test_views(app, client):
resp = client.get('/oarepo/indices')
resp = client.get('/oarepo/indices/')
assert resp.status_code == 200
assert resp.json == {
'default-facets': {'facets': {'category': {'label': 'oarepo.facets.default-facets.category.label'}},
Expand All @@ -23,7 +23,7 @@ def test_views(app, client):
'translate-filter': {'facets': {},
'filters': {'category': {'label': 'my.own.filter.label'}}}}

resp = client.get('/oarepo/indices?ln=cs')
resp = client.get('/oarepo/indices/?ln=cs')
assert resp.status_code == 200
assert resp.json == {
'default-facets': {'facets': {'category': {'label': 'defaultní.kategorie'}},
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_view(app, client):

def test_perms(app, client):
# special permission handler that returns only facets for indices starting with translate-*
resp = client.get('/oarepo/indices?perms=1')
resp = client.get('/oarepo/indices/?perms=1')
assert resp.status_code == 200
assert resp.json == {
'default-facets': {'facets': {'category': {'label': 'oarepo.facets.default-facets.category.label'}},
Expand Down

0 comments on commit ae0b595

Please sign in to comment.