From 6f7ccfd0966731f6682a43b3c5c76c6777faa5bb Mon Sep 17 00:00:00 2001 From: index-git Date: Wed, 12 May 2021 16:37:42 +0200 Subject: [PATCH] Create test for refresh map thumbnail after WFS-T query to included layer --- src/layman/layer_map_relation_test.py | 40 ++++++++++++++++++ .../map_with_internal_layer_basic.png | Bin 0 -> 4589 bytes ...p_with_internal_layer_basic_after_wfst.png | Bin 0 -> 4684 bytes 3 files changed, 40 insertions(+) create mode 100644 src/layman/layer_map_relation_test.py create mode 100644 test/data/thumbnail/map_with_internal_layer_basic.png create mode 100644 test/data/thumbnail/map_with_internal_layer_basic_after_wfst.png diff --git a/src/layman/layer_map_relation_test.py b/src/layman/layer_map_relation_test.py new file mode 100644 index 000000000..3797d25d1 --- /dev/null +++ b/src/layman/layer_map_relation_test.py @@ -0,0 +1,40 @@ +from test import process_client, util as test_util +from test.data import map as map_data, wfs as data_wfs +import pytest + +from layman import app +from layman.map.filesystem import thumbnail + + +@pytest.mark.usefixtures('ensure_layman') +def test_map_refresh_after_layer_change(): + workspace = 'test_map_refresh_after_layer_change_workspace' + layer = 'test_map_refresh_after_layer_change_layer' + map = 'test_map_refresh_after_layer_change_map' + bbox = (1571000.0, 6268800.0, 1572590.8542062, 6269876.33561699) + + process_client.publish_workspace_layer(workspace, layer) + + map_file = map_data.create_map_with_internal_layers_file([(workspace, layer)], extent_3857=bbox) + process_client.publish_workspace_map(workspace, map, file_paths=[map_file]) + + expected_thumbnail_path = f'/code/test/data/thumbnail/map_with_internal_layer_basic.png' + with app.app_context(): + thumbnail_path = thumbnail.get_map_thumbnail_path(workspace, map) + diffs = test_util.compare_images(expected_thumbnail_path, thumbnail_path) + assert diffs < 10, expected_thumbnail_path + + data_xml = data_wfs.get_wfs20_insert_points(workspace, layer, ) + process_client.post_wfst(data_xml) + process_client.wait_for_publication_status(workspace, process_client.LAYER_TYPE, layer) + + process_client.wait_for_publication_status(workspace, process_client.MAP_TYPE, map) + + expected_thumbnail_path = f'/code/test/data/thumbnail/map_with_internal_layer_basic_after_wfst.png' + with app.app_context(): + thumbnail_path = thumbnail.get_map_thumbnail_path(workspace, map) + diffs = test_util.compare_images(expected_thumbnail_path, thumbnail_path) + assert diffs < 10, expected_thumbnail_path + + process_client.delete_workspace_map(workspace, map) + process_client.delete_workspace_layer(workspace, layer) diff --git a/test/data/thumbnail/map_with_internal_layer_basic.png b/test/data/thumbnail/map_with_internal_layer_basic.png new file mode 100644 index 0000000000000000000000000000000000000000..35316e3f79f76f65a327c60a942fdc754de6c31f GIT binary patch literal 4589 zcmeHLXIB&J7EVIY7(f#xQWOCV2q7qn;PFrrN`TOdRH-6h00k)`Js?pL5eXtHhXfUj zQX^HxNRe`BMi4^p0tVzrh(hRhyuaXnJnLRR%v!Vde&78*v-dO4-ZRP8md0XmX*dW3 z5+j-z+JZn}?5_*91F%HK-VFzVkQGEjy|dTc7e;~t?SIO&@YrWo&dW`b8^x6#;x((z zj11Qr%D(6dl)8`-+ND;t^K#=+-z!1`{rjXKNLV03?nQR%bE|> z7>ZCkg7cL|3?V^8|sVJZ(QT@s;gJn)Gai3 zEVcIJ0nGvsrT0ba@z*nBRJ`1zDh=Im+?b+81xlYQBZ+)zdv z_nEPxei=_aJu0ZoRB?3IoQ1fDyV=@qdMgmijwUg!ZHr{k+P>1XJHsA#hJLF~4I=I^ zbtt_C&3YR+aB?K1T~#A!V7nk-?0xJL7K^n+S<`0Y!rj}ZLv*8;zy0WVq`tQJVUK~8 zl@%4;iqnVHW>(~sI`?*b6jH)g`*}Xf>*b03-I6BTM-h?e>FLRPX~*y%tRP9_;$k}0 za&mHR$A8SxVpLUWvbML@|Gc*7IlZt~J}C=*Dg8%Or^E~xc2>Dgr3mvxG|mNkPgYc8 zCA`nAZ)kYf)!*OW)VJfIjq)Ox? zP49@2rXt=;N~Gw}^A2{M7}taKBbe?^QyJ(pS!iMeZI+(Z z<8?hp8Hx8qLpUPyg+%H*q`s3pY10IBO%wv_M*^#D)}n|x)Tjlfx-tZI$1oQO4?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