|
1 | | -import urllib |
2 | | - |
3 | 1 | import attr |
4 | 2 | import pytest |
5 | 3 | import requests_mock |
@@ -51,23 +49,11 @@ def test_filtered_item_search(client): |
51 | 49 | key = 'dc.title' |
52 | 50 | string = 'test' |
53 | 51 | query_type = 'contains' |
54 | | - # selected_collections = '' |
55 | 52 | endpoint = '/rest/filtered-items?' |
56 | | - # params1 = {'query_field[]': key, 'query_op[]': query_type, |
57 | | - # 'query_val[]': string, '&collSel[]': |
58 | | - # selected_collections, 'limit': 200, 'offset': 0} |
59 | | - # params2 = {'query_field[]': key, 'query_op[]': query_type, |
60 | | - # 'query_val[]': string, '&collSel[]': |
61 | | - # selected_collections, 'limit': 200, 'offset': 200} |
62 | | - # enc_params1 = urllib.parse.urlencode(params1) |
63 | | - # enc_params2 = urllib.parse.urlencode(params2) |
64 | | - # print(f'{endpoint}{enc_params1}') |
65 | | - # print(f'{endpoint}{enc_params2}') |
66 | 53 | json_object_1 = {'items': [{'link': '1234'}]} |
67 | 54 | json_object_2 = {'items': []} |
68 | 55 | m.get(endpoint, [{'json': json_object_1}, {'json': json_object_2}]) |
69 | | - # m.get(f'{endpoint}{enc_params1}', json=json_object_1) |
70 | | - # m.get(f'{endpoint}{enc_params2}', json=json_object_2) |
| 56 | + |
71 | 57 | item_links = client.filtered_item_search(key, string, query_type, |
72 | 58 | selected_collections='') |
73 | 59 | assert '1234' in item_links |
|
0 commit comments