diff --git a/nomad/app/api/repo.py b/nomad/app/api/repo.py index a7830d89226774e3a573947c08339d18c22a48e5..abab84b01d97b812cf34b336b0437caa6473fde3 100644 --- a/nomad/app/api/repo.py +++ b/nomad/app/api/repo.py @@ -232,6 +232,8 @@ class RepoCalcsResource(Resource): code_args = dict(request.args) if 'statistics' in code_args: del(code_args['statistics']) + import json + utils.get_logger(__name__).info('create code snippets', code_args=json.dumps(code_args)) results['curl'] = query_api_curl('archive', 'query', query_string=code_args) results['python'] = query_api_python('archive', 'query', query_string=code_args) diff --git a/tests/app/test_api.py b/tests/app/test_api.py index f2efed254c43b1d3510174a3378df9cadce808dc..61403213af66122a3ed3f8631da965335259e9b9 100644 --- a/tests/app/test_api.py +++ b/tests/app/test_api.py @@ -1076,13 +1076,11 @@ class TestRepo(): assert data['pagination']['total'] > 0 def test_get_code_from_query(self, api, example_elastic_calcs, test_user_auth): - rv = api.get('/repo/?per_page=10', headers=test_user_auth) + rv = api.get('/repo/?code_name=VASP', headers=test_user_auth) assert rv.status_code == 200 data = json.loads(rv.data) assert data['python'] is not None assert data['curl'] is not None - # exec does not seem to work - # exec(data['python']) class TestEditRepo():