Skip to content

Commit

Permalink
test: fixes flaky test under test_rule_transform_task.py
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Oct 17, 2023
1 parent a9aa144 commit daeb8f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/trestlebot/tasks/test_rule_transform_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,24 @@ def test_rule_transform_task(tmp_trestle_dir: str) -> None:
assert orig_comp.components is not None
assert len(orig_comp.components) == 2

component = orig_comp.components[0]
component = next(
(comp for comp in orig_comp.components if comp.title == "Component 2"), None
)

assert component is not None
assert component.props is not None
assert component.title == "Component 2"
assert len(component.props) == 2
assert component.props[0].name == RULE_ID
assert component.props[0].value == "example_rule_2"
assert component.props[1].name == RULE_DESCRIPTION
assert component.props[1].value == "My rule description for example rule 2"

component = orig_comp.components[1]
component = next(
(comp for comp in orig_comp.components if comp.title == "Component 1"), None
)

assert component is not None
assert component.props is not None
assert component.title == "Component 1"
assert len(component.props) == 5
assert component.props[0].name == RULE_ID
assert component.props[0].value == "example_rule_1"
Expand Down

0 comments on commit daeb8f1

Please sign in to comment.