From c45a05d88222361c1f0e422ab5c417f3183f8cd5 Mon Sep 17 00:00:00 2001 From: Doug Latornell Date: Tue, 8 Nov 2022 13:21:30 -0800 Subject: [PATCH] Add prod config YAML unit tests for watch_ww3 Test suite maintenance. re: issue #117 --- tests/workers/test_watch_ww3.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/workers/test_watch_ww3.py b/tests/workers/test_watch_ww3.py index 027191e8..8400de9c 100644 --- a/tests/workers/test_watch_ww3.py +++ b/tests/workers/test_watch_ww3.py @@ -58,6 +58,29 @@ def test_add_run_type_arg(self, mock_worker): assert worker.cli.parser._actions[4].help +class TestConfig: + """Unit tests for production YAML config file elements related to worker.""" + + def test_message_registry(self, prod_config): + assert "watch_ww3" in prod_config["message registry"]["workers"] + msg_registry = prod_config["message registry"]["workers"]["watch_ww3"] + assert msg_registry["checklist key"] == "WWATCH3 run" + + def test_message_registry_keys(self, prod_config): + msg_registry = prod_config["message registry"]["workers"]["watch_ww3"] + assert list(msg_registry.keys()) == [ + "checklist key", + "need", + "success forecast2", + "failure forecast2", + "success nowcast", + "failure nowcast", + "success forecast", + "failure forecast", + "crash", + ] + + @pytest.mark.parametrize( "run_type, host_name", (