Skip to content

Commit

Permalink
Add prod config YAML unit tests for watch_ww3
Browse files Browse the repository at this point in the history
Test suite maintenance.

re: issue #117
  • Loading branch information
douglatornell committed Nov 8, 2022
1 parent 1181fcd commit c45a05d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/workers/test_watch_ww3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
(
Expand Down

0 comments on commit c45a05d

Please sign in to comment.