Example #1
0
 def test_Closure(self):
     m = Matrix(4, 4)
     m.addString([1, 1, 1, 1])
     m.addString([0, 0, 1, 1])
     m.addString([1, 1, 0, 1])
     m.addString([1, 0, 1, 1])
     graph = Hasse(m)
     node = Node({0, 3})
     expectedNode = Node({0, 2, 3})
     newNode = graph.closure(node, 2)
     self.assertSetEqual(expectedNode.getElements(), newNode.getElements())
Example #2
0
 def test_GetElements(self):
     elements = {0, 1, 2}
     node0 = Node({0, 1, 2})
     self.assertEqual(elements, node0.getElements())