Skip to content

Commit

Permalink
Check number of main files for POST zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
index-git committed Oct 27, 2021
1 parent 4f57778 commit dd8c23f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Binary file not shown.
26 changes: 26 additions & 0 deletions tests/dynamic_data/publications.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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, {
Expand Down

0 comments on commit dd8c23f

Please sign in to comment.