@@ -10,3 +10,18 @@ def test_connections_uniqueness(self):
1010 connection_1 = D2HashableConnection ("a" , "b" , "some_label" , Direction .TO )
1111 connection_2 = D2HashableConnection ("a" , "b" , "some_label" , Direction .TO )
1212 assert connection_1 == connection_2
13+
14+ def test_connections_hash (self ):
15+ connection_1 = D2HashableConnection ("a" , "b" , "some_label" , Direction .TO )
16+ assert isinstance (connection_1 .__hash__ (), int )
17+
18+ def test_connections_not_equal (self ):
19+ connection_1 = D2HashableConnection ("a" , "b" , "some_label" , Direction .TO )
20+ connection_2 = D2HashableConnection ("a" , "b" , "some_label2" , Direction .TO )
21+ connection_3 = D2HashableConnection ("a1" , "b" , "some_label" , Direction .TO )
22+ connection_4 = D2HashableConnection ("a" , "b1" , "some_label" , Direction .TO )
23+ connection_5 = D2HashableConnection ("a" , "b" , "some_label" , Direction .FROM )
24+ assert connection_1 != connection_2
25+ assert connection_1 != connection_3
26+ assert connection_1 != connection_4
27+ assert connection_1 != connection_5
0 commit comments