From 6b39341e84cd74f47e879e75b432aa652fc07152 Mon Sep 17 00:00:00 2001 From: Markus Scheidgen <markus.scheidgen@gmail.com> Date: Tue, 23 Apr 2019 10:53:16 +0200 Subject: [PATCH] Fixed search test to use comma separated atoms instead of not supported multiple parameter usage. --- dependencies/parsers/skeleton | 2 +- nomad/search.py | 3 ++- tests/test_api.py | 6 +----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dependencies/parsers/skeleton b/dependencies/parsers/skeleton index 6744335e87..9be5899380 160000 --- a/dependencies/parsers/skeleton +++ b/dependencies/parsers/skeleton @@ -1 +1 @@ -Subproject commit 6744335e87c6ec60190c092eedc4c12d54baae17 +Subproject commit 9be589938071b2fd4f884f8d930d736fe32b6166 diff --git a/nomad/search.py b/nomad/search.py index 73a4873a6e..2d0edc4c7a 100644 --- a/nomad/search.py +++ b/nomad/search.py @@ -244,6 +244,7 @@ def _construct_search(q: Q = None, time_range: Tuple[datetime, datetime] = None, for item in values: if key == 'atoms': + # TODO This should be configurable and not specific to atoms items = item.split(',') else: items = [item] @@ -263,7 +264,7 @@ def scroll_search( :func:`aggregate_search`, but pagination is replaced with scrolling, no ordering, and no aggregation information is given. - Scrolling is done by calling this function again and again with the same ``scoll_id``. + Scrolling is done by calling this function again and again with the same ``scroll_id``. Each time, this function will return the next batch of search results. See see :func:`aggregate_search` for additional ``kwargs`` diff --git a/tests/test_api.py b/tests/test_api.py index ad1b20a044..1ce7e70634 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -675,11 +675,7 @@ class TestRepo(): (0, 'quantities', 'dos') ]) def test_search_quantities(self, client, example_elastic_calcs, no_warn, test_user_auth, calcs, quantity, value): - if isinstance(value, list): - query_string = '&'.join('%s=%s' % (quantity, item) for item in value) - else: - query_string = '%s=%s' % (quantity, value) - + query_string = '%s=%s' % (quantity, ','.join(value) if isinstance(value, list) else value) rv = client.get('/repo/?%s' % query_string, headers=test_user_auth) assert rv.status_code == 200 -- GitLab