diff --git a/tests/trestlebot/tasks/test_rule_transform_task.py b/tests/trestlebot/tasks/test_rule_transform_task.py index c7d4dd2e..3c1e0c9d 100644 --- a/tests/trestlebot/tasks/test_rule_transform_task.py +++ b/tests/trestlebot/tasks/test_rule_transform_task.py @@ -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"