Skip to content

Commit

Permalink
Merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWatzinger committed Oct 24, 2023
2 parents 1553dbd + 979748e commit 0054184
Showing 1 changed file with 23 additions and 45 deletions.
68 changes: 23 additions & 45 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,33 @@ def test_api(self) -> None:
# ---Type Endpoints---
for rv in [
self.app.get(url_for('api_03.type_overview')),
self.app.get(url_for('api_03.type_overview', download=True))]:
rv = rv.get_json()['place'][0]['children'][0]
assert bool(rv['label'] == 'Austria')
self.app.get(
url_for('api_03.type_overview', download=True))]:
found = False
for item in rv.get_json()['place']:
if found:
break
if item['name'] == 'Administrative unit':
for children in item['children']:
if children['label'] == 'Austria':
found = True
break
assert found

for rv in [
self.app.get(url_for('api_03.type_by_view_class')),
self.app.get(
url_for('api_03.type_by_view_class', download=True))]:
rv = rv.get_json()['place'][2]['children'][0]
assert bool(rv['label'] == 'Boundary Mark')
url_for('api_03.type_by_view_class', download=True))]:
found = False
for item in rv.get_json()['place']:
if found:
break
if item['name'] == 'Place':
for children in item['children']:
if children['label'] == 'Boundary Mark':
found = True
break
assert found

for rv in [
self.app.get(url_for('api_03.type_tree')),
Expand Down Expand Up @@ -803,45 +820,6 @@ def test_api(self) -> None:
last=place.id))
assert 'ID is last entity' in rv.get_json()['title']

# for rv in [
# self.app.get(url_for('api_03.query', entities=12345)),
# self.app.get(
# url_for(
# 'api_03.cidoc_class',
# cidoc_class='E68',
# last=1231)),
# self.app.get(
# url_for(
# 'api_03.view_class',
# view_class='place',
# search=
# '{"typeName":[{"operator":"equal",'
# '"values":'
# '["Boundary Mark", "Height", "Dimension"],'
# '"logicalOperator":"and"}]}')),
# self.app.get(
# url_for(
# 'api_03.view_class',
# view_class='place',
# search=
# '{"beginFrom":[{"operator":"lesserThan",'
# '"values":["2000-1-1"],'
# '"logicalOperator":"or"}]}')),
# self.app.get(
# url_for(
# 'api_03.query',
# entities=place.id,
# cidoc_classes='E18',
# view_classes='artifact',
# system_classes='person',
# format='lp',
# search=
# '{"entityDescription":[{"operator":"like",'
# '"values":["IS", "sam", "FrOdo"],'
# '"logicalOperator":"and"}]}'))]:
# rv = rv.get_json()
# assert 'No entity available' in rv['title']

rv = self.app.get(
url_for(
'api_03.query',
Expand Down

0 comments on commit 0054184

Please sign in to comment.