Skip to content

Commit

Permalink
assert_exp_layer_maps only for enumerated workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
index-git committed Sep 26, 2023
1 parent 6092856 commit 138ac91
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class TestPublication(base_test.TestSingleRestPublication):
usernames_to_reserve = [PRIVATE_WORKSPACE]

test_cases = [base_test.TestCaseType(key=key,
publication=Publication(f'{WORKSPACE}_{key}', None, None),
params=params,
rest_args=params['rest_args'],
rest_method=params['rest_method'],
Expand Down Expand Up @@ -190,7 +191,7 @@ def assert_exp_map_layers(self, map, exp_map_layers, exp_operates_on, http_metho
})

@staticmethod
def assert_exp_layer_maps(layer, map_operates_on_tuples):
def assert_exp_layer_maps(layer, map_operates_on_tuples, workspaces_to_check):
exp_layer_maps = sorted([
(map.workspace, map.name)
for map, operates_on in map_operates_on_tuples
Expand All @@ -200,6 +201,7 @@ def assert_exp_layer_maps(layer, map_operates_on_tuples):
found_layer_maps = [
(m['workspace'], m['name'])
for m in get_publication_info(*layer, context={'keys': ['layer_maps']})['_layer_maps']
if m['workspace'] in workspaces_to_check
]
assert found_layer_maps == exp_layer_maps

Expand All @@ -216,7 +218,7 @@ def test_publication(self, map, rest_method, rest_args, params):
self.assert_exp_layer_maps(LAYER_HRANICE, [
(MAP_HRANICE, MAP_HRANICE_OPERATES_ON),
(map, exp['operates_on'] or []),
])
], workspaces_to_check=[map.workspace, MAP_HRANICE.workspace, PRIVATE_WORKSPACE])
self.assert_exp_map_thumbnail(map, exp['thumbnail'])

rest_method.fn(map, args=rest_args)
Expand All @@ -231,5 +233,5 @@ def test_publication(self, map, rest_method, rest_args, params):
self.assert_exp_layer_maps(LAYER_HRANICE, [
(MAP_HRANICE, MAP_HRANICE_OPERATES_ON),
(map, exp['operates_on'] or []),
])
], workspaces_to_check=[map.workspace, MAP_HRANICE.workspace, PRIVATE_WORKSPACE])
self.assert_exp_map_thumbnail(map, exp['thumbnail'])

0 comments on commit 138ac91

Please sign in to comment.