Skip to content

Commit

Permalink
Fix same_values_in_detail_and_multi for async wrong input tests
Browse files Browse the repository at this point in the history
  • Loading branch information
index-git committed Jun 23, 2023
1 parent 98723f8 commit d233a72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/asserts/final/publication/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def async_error_in_info_key(rest_publication_detail, info_key, expected):
rest_publication_detail[info_key]['error'])


def same_values_in_detail_and_multi(workspace, publ_type, name, rest_publication_detail, headers):
def same_values_in_detail_and_multi(workspace, publ_type, name, rest_publication_detail, headers, *, different_value_keys=None):
different_value_keys = different_value_keys or []
# keep only multi-endpoint keys
expected_keys = ['workspace', 'name', 'title', 'uuid', 'url', 'updated_at', 'access_rights', 'bounding_box',
'native_crs', 'native_bounding_box']
Expand Down Expand Up @@ -48,6 +49,9 @@ def same_values_in_detail_and_multi(workspace, publ_type, name, rest_publication
wfs_wms_status = 'AVAILABLE'
exp_info['wfs_wms_status'] = wfs_wms_status

for key in different_value_keys:
exp_info.pop(key)

multi_requests = [
(process_client.get_workspace_publications, [publ_type, workspace], {'headers': headers}),
(process_client.get_publications, [publ_type], {'headers': headers}),
Expand All @@ -59,4 +63,6 @@ def same_values_in_detail_and_multi(workspace, publ_type, name, rest_publication
assert len(rest_multi_infos) == 1, f'rest_multi_infos={rest_multi_infos}'
rest_multi_info = rest_multi_infos[0]

for key in different_value_keys:
rest_multi_info.pop(key)
assert rest_multi_info == exp_info
Original file line number Diff line number Diff line change
Expand Up @@ -1408,4 +1408,5 @@ def test_publication(self, publication: Publication, rest_method, rest_args, par
name=publication.name,
rest_publication_detail=rest_publication_detail,
headers=None,
different_value_keys=['file', 'geodata_type'],
)

0 comments on commit d233a72

Please sign in to comment.