Skip to content

Commit

Permalink
Create test for refresh map thumbnail after WFS-T query to included l…
Browse files Browse the repository at this point in the history
…ayer
  • Loading branch information
index-git committed May 14, 2021
1 parent 87d49f1 commit 6f7ccfd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/layman/layer_map_relation_test.py
Original file line number Diff line number Diff line change
@@ -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)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f7ccfd

Please sign in to comment.