Skip to content

Commit cff025f

Browse files
yt-msMidnighter
authored andcommitted
test: fix test_element, remove redundant code
1 parent fc37cc2 commit cff025f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/structurizr/model/implied_relationship_strategies.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,13 @@ def _implied_relationship_is_allowed(source: Element, destination: Element):
8181
) and destination not in _get_ancestors(source)
8282

8383

84-
def _get_ancestors(element: Element, include_self=True) -> List[Element]:
84+
def _get_ancestors(element: Element) -> List[Element]:
8585
"""Get the ancestors of an element."""
8686
result = []
8787
current = element
8888
while current is not None:
8989
result.append(current)
9090
current = None if isinstance(current, SoftwareSystem) else current.parent
91-
if not include_self:
92-
result.remove(element)
9391
return result
9492

9593

tests/unit/model/test_element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ConcreteElement(Element):
3030
class MockModel:
3131
"""Implement a mock model for reference testing."""
3232

33-
def add_relationship(self, relationship):
33+
def add_relationship(self, relationship, create_implied_relationships):
3434
"""Provide mock implementation."""
3535
return relationship
3636

0 commit comments

Comments
 (0)