diff --git a/test_tools/data/layers/layer_with_two_main_files.zip b/test_tools/data/layers/layer_with_two_main_files.zip new file mode 100644 index 000000000..c26e09ca9 Binary files /dev/null and b/test_tools/data/layers/layer_with_two_main_files.zip differ diff --git a/tests/dynamic_data/publications.py b/tests/dynamic_data/publications.py index 12cfa4304..aa6049743 100644 --- a/tests/dynamic_data/publications.py +++ b/tests/dynamic_data/publications.py @@ -1,3 +1,4 @@ +from layman import LaymanError import tests.asserts.final.publication as publication import tests.asserts.processing as processing from test_tools import process_client @@ -52,6 +53,31 @@ }, ], Publication(consts.COMMON_WORKSPACE, consts.LAYER_TYPE, 'zipped_sld'): [ + { + consts.KEY_ACTION: { + consts.KEY_CALL: Action(process_client.publish_workspace_publication, { + 'file_paths': ['test_tools/data/layers/layer_with_two_main_files.zip'], + }), + consts.KEY_CALL_EXCEPTION: { + consts.KEY_EXCEPTION: LaymanError, + consts.KEY_EXCEPTION_ASSERTS: [ + Action(processing.exception.response_exception, {'expected': {'http_code': 400, + 'code': 2, + 'message': 'Wrong parameter value', + 'detail': { + 'expected': 'At most one file with any of extensions: .geojson, .shp, .tiff, .tif, .jp2, .png, .jpg', + 'files': [ + 'layer_with_two_main_files.zip/layer_with_two_main_files/geojson/small_layer.geojson', + 'layer_with_two_main_files.zip/layer_with_two_main_files/raster/sample_tif_rgb.tif'], + 'parameter': 'file'}, + }, }, ), + ], + }, + }, + consts.KEY_FINAL_ASSERTS: [ + Action(publication.internal.does_not_exist, dict()) + ], + }, { consts.KEY_ACTION: { consts.KEY_CALL: Action(process_client.publish_workspace_publication, {