From 8c48279728b8484dc4b9b022a87df56f89314542 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Sanchez Date: Wed, 18 Dec 2024 17:40:44 -0300 Subject: [PATCH] Extend tests to support new components_json field. --- src/narrativelog/testutils.py | 5 +++++ tests/test_add_message.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/narrativelog/testutils.py b/src/narrativelog/testutils.py index 4673cba..f6479d8 100644 --- a/src/narrativelog/testutils.py +++ b/src/narrativelog/testutils.py @@ -63,6 +63,11 @@ TEST_PRIMARY_HARDWARE_COMPONENTS = [ f"primary_hardware_component{n}" for n in range(10) ] +TEST_COMPONENTS_JSON = { + "systems": TEST_SYSTEMS, + "subsystems": TEST_SUBSYSTEMS, + "components": TEST_COMPONENTS, +} # Type annotation aliases MessageDictT = dict[str, typing.Any] diff --git a/tests/test_add_message.py b/tests/test_add_message.py index e2b051d..498e2f2 100644 --- a/tests/test_add_message.py +++ b/tests/test_add_message.py @@ -7,6 +7,7 @@ from narrativelog.testutils import ( TEST_COMPONENTS, + TEST_COMPONENTS_JSON, TEST_CSCS, TEST_PRIMARY_HARDWARE_COMPONENTS, TEST_PRIMARY_SOFTWARE_COMPONENTS, @@ -90,6 +91,7 @@ async def test_add_message(self) -> None: add_args_full["primary_hardware_components"] = random_strings( TEST_PRIMARY_HARDWARE_COMPONENTS ) + add_args_full["components_json"] = TEST_COMPONENTS_JSON add_args_full["category"] = "test" add_args_full["time_lost_type"] = random.choice( ["fault", "weather"]