From aefe5632a3a1dbd0e6bf859e400b216fdae12afa Mon Sep 17 00:00:00 2001 From: burnout87 Date: Fri, 1 Dec 2023 14:49:18 +0100 Subject: [PATCH 1/4] adapt testtest_request_too_large --- requirements.txt | 2 +- tests/test_plugin.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index ce16571..85ea6d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ --e git+https://github.com/oda-hub/dispatcher-app.git@master#egg=cdci_data_analysis[test] +-e git+https://github.com/oda-hub/dispatcher-app.git@format-backend-error-msg#egg=cdci_data_analysis[test] astropy simple_logger numpy diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 7d91b3a..201dc19 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -197,9 +197,8 @@ def test_request_too_large(dispatcher_live_fixture): assert c.status_code == 200 assert jdata['job_status'] == 'failed' - assert 'SPI-ACS backend refuses to process this request' in jdata['exit_status']['error_message'] - - + assert 'SPI-ACS backend refuses to process this request' in jdata['exit_status']['debug_message'] + assert 'Instrument: spi_acs, product: spi_acs_lc' in jdata['exit_status']['error_message'] @pytest.mark.parametrize("roles", ["integral-realtime", ""]) From 8d6846884440e242a072803e95cb54357b8eab7d Mon Sep 17 00:00:00 2001 From: burnout87 Date: Fri, 1 Dec 2023 14:52:13 +0100 Subject: [PATCH 2/4] addressing pep8speaks comment --- tests/test_plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 201dc19..27f7249 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -197,8 +197,10 @@ def test_request_too_large(dispatcher_live_fixture): assert c.status_code == 200 assert jdata['job_status'] == 'failed' - assert 'SPI-ACS backend refuses to process this request' in jdata['exit_status']['debug_message'] - assert 'Instrument: spi_acs, product: spi_acs_lc' in jdata['exit_status']['error_message'] + assert ('SPI-ACS backend refuses to process this request' in + jdata['exit_status']['debug_message']) + assert ('Instrument: spi_acs, product: spi_acs_lc' in + jdata['exit_status']['error_message']) @pytest.mark.parametrize("roles", ["integral-realtime", ""]) From b0fae5ba027297d3d3dcb9e583f08c19827c33ce Mon Sep 17 00:00:00 2001 From: burnout87 Date: Fri, 1 Dec 2023 15:50:58 +0100 Subject: [PATCH 3/4] using master branch --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 85ea6d2..ce16571 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ --e git+https://github.com/oda-hub/dispatcher-app.git@format-backend-error-msg#egg=cdci_data_analysis[test] +-e git+https://github.com/oda-hub/dispatcher-app.git@master#egg=cdci_data_analysis[test] astropy simple_logger numpy From 86dd16359624d5bc46d39c24208dc4d67311200b Mon Sep 17 00:00:00 2001 From: burnout87 Date: Fri, 1 Dec 2023 15:51:03 +0100 Subject: [PATCH 4/4] test more generic --- tests/test_plugin.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 27f7249..c97cfb6 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -197,10 +197,7 @@ def test_request_too_large(dispatcher_live_fixture): assert c.status_code == 200 assert jdata['job_status'] == 'failed' - assert ('SPI-ACS backend refuses to process this request' in - jdata['exit_status']['debug_message']) - assert ('Instrument: spi_acs, product: spi_acs_lc' in - jdata['exit_status']['error_message']) + assert any('SPI-ACS backend refuses to process this request' in r for r in jdata['exit_status'].values()) @pytest.mark.parametrize("roles", ["integral-realtime", ""])