예제 #1
0
 def test_node_hashing(self):
     node_1 = Node()
     node_1.id = 1234
     node_2 = Node()
     node_2.id = 1234
     node_3 = Node()
     node_3.id = 5678
     assert hash(node_1) == hash(node_2)
     assert hash(node_1) != hash(node_3)
예제 #2
0
 def test_node_equality(self):
     node_1 = Node()
     node_1.id = 1234
     node_2 = Node()
     node_2.id = 1234
     node_3 = Node()
     node_3.id = 5678
     assert node_1 == node_2
     assert node_1 != node_3
     assert node_1 != "this is not a node"