Skip to content

Commit 49de1bf

Browse files
yt-msMidnighter
authored andcommitted
style: PR feedback
1 parent 7caaa51 commit 49de1bf

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

tests/integration/test_model_element_relationships.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_adding_relationship_via_uses_adds_to_elements():
8686
"filename",
8787
["BigBank.json"],
8888
)
89-
def test_relationships_after_deserialisation_are_consistent(filename):
89+
def test_relationships_after_deserialisation_are_consistent(filename: str):
9090
"""Make sure that relationships are consistent between the Model and the Element after deserialisation."""
9191
path = DEFINITIONS / filename
9292
workspace = Workspace.load(path)
@@ -100,6 +100,6 @@ def test_relationships_after_deserialisation_are_consistent(filename):
100100
len(list(atm.get_relationships())) == 2
101101
) # One to mainframe, one from personal banking customer
102102
assert len(list(atm.get_afferent_relationships())) == 1
103-
assert list(atm.get_afferent_relationships())[0].source is customer
103+
assert next(atm.get_afferent_relationships()).source is customer
104104
assert len(list(atm.get_efferent_relationships())) == 1
105-
assert list(atm.get_efferent_relationships())[0].destination is mainframe
105+
assert next(atm.get_efferent_relationships()).destination is mainframe

tests/unit/model/test_element.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ def test_element_can_only_add_relationship_to_source():
6868

6969

7070
def test_element_add_relationship_can_omit_source():
71-
"""
72-
When using add_relationship with params rather than an existing instance,
73-
it should default the source.
74-
"""
71+
"""Expect that creating a relationship uses the default source."""
7572
element1 = ConcreteElement(name="elt1")
7673
element2 = ConcreteElement(name="elt1")
7774
model = MockModel()
@@ -81,9 +78,7 @@ def test_element_add_relationship_can_omit_source():
8178

8279

8380
def test_element_add_relationship_twice_is_ok():
84-
"""
85-
Defensive test that adding the same relationship twice is fine.
86-
"""
81+
"""Ensure that adding the same relationship twice is fine."""
8782
element1 = ConcreteElement(name="elt1")
8883
element2 = ConcreteElement(name="elt1")
8984
model = MockModel()

0 commit comments

Comments
 (0)