Skip to content

Commit

Permalink
assert_exp_layer_maps only for enumerated workspaces
Browse files Browse the repository at this point in the history
Otherwise, assert_exp_layer_maps fails with --nocleanup or parallel tests
  • Loading branch information
index-git committed Sep 26, 2023
1 parent 842f847 commit d491b06
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,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 @@ -191,7 +192,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 @@ -201,6 +202,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 @@ -217,7 +219,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 @@ -232,5 +234,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 d491b06

Please sign in to comment.