Skip to content

Commit

Permalink
catch future meta breakages
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud committed Apr 24, 2024
1 parent 144e7d6 commit 902e9db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions clastic/tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ def ep_method(self):

resp = cl.get('/meta/json/')
assert resp.status_code == 200
resp_data = json.loads(resp.data)

endpoints = [r['endpoint'] for r in json.loads(resp.data)['app']['routes']]
endpoints = [r['endpoint'] for r in resp_data['app']['routes']]
assert endpoints == [{'module_name': 'clastic.tests.test_meta', 'name': 'func_ep'},
{'module_name': 'clastic.tests.test_meta.CallableObj', 'name': 'ep_method'},
{'module_name': 'clastic.tests.test_meta', 'name': 'CallableObj'},
Expand All @@ -70,7 +71,9 @@ def ep_method(self):
'name': 'get_file_response'},
{'module_name': 'clastic.meta.MetaApplication', 'name': 'get_main'},
{'module_name': 'builtins', 'name': 'sum'}]


for peripheral, info in resp_data.items():
assert 'exc_content' not in info, f'failed meta context for domain "{peripheral}": {info["exc_content"]}'

def test_resource_redaction():
app = Application(routes=[('/meta', MetaApplication())],
Expand Down

0 comments on commit 902e9db

Please sign in to comment.