From 78808096828c56b245d09682d16af1b1e9252c86 Mon Sep 17 00:00:00 2001 From: Jiri Kozel Date: Mon, 27 Nov 2023 17:17:13 +0100 Subject: [PATCH] Make one part of test_post_layers_long_and_delete_it optional --- src/layman/layer/rest_workspace_test.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/layman/layer/rest_workspace_test.py b/src/layman/layer/rest_workspace_test.py index af695ef13..a18eece0b 100644 --- a/src/layman/layer/rest_workspace_test.py +++ b/src/layman/layer/rest_workspace_test.py @@ -909,10 +909,13 @@ def test_post_layers_long_and_delete_it(client): chain_info = util.get_layer_chain(workspace, layername) assert chain_info is not None and not celery_util.is_chain_ready(chain_info) - layer_info = util.get_layer_info(workspace, layername) - keys_to_check = ['db', 'wms', 'wfs', 'thumbnail', 'metadata'] - for key_to_check in keys_to_check: - assert 'status' in layer_info[key_to_check] + layer_info = util.get_complete_layer_info(workspace, layername) + + # sometimes, "long" post is not long enough and the layer is already in COMPLETE state + if layer_info['layman_metadata']['publication_status'] == 'UPDATING': + keys_to_check = ['db', 'wms', 'wfs', 'thumbnail', 'metadata'] + for key_to_check in keys_to_check: + assert 'status' in layer_info[key_to_check] rest_path = url_for('rest_workspace_layer.delete_layer', workspace=workspace, layername=layername) response = client.delete(rest_path)