Skip to content

Commit

Permalink
Extend tests to support new components_json field.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-aranda committed Dec 18, 2024
1 parent 66b8f7d commit e0f2dff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/narrativelog/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_add_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from narrativelog.testutils import (
TEST_COMPONENTS,
TEST_COMPONENTS_JSON,
TEST_CSCS,
TEST_PRIMARY_HARDWARE_COMPONENTS,
TEST_PRIMARY_SOFTWARE_COMPONENTS,
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit e0f2dff

Please sign in to comment.