File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -68,10 +68,7 @@ def test_element_can_only_add_relationship_to_source():
6868
6969
7070def 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
8380def 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 ()
You can’t perform that action at this time.
0 commit comments