def testSESE2(self): G, head, tail = makeGraph(2) result = findCycleEquivalences(G, head, tail) self.assertEqual(result.entry, head) self.assertEqual(result.exit, tail) self.assertEqual(set(result.nodes), set((1, 2, 3, 5, 6, 7))) self.assertEqual(len(result.children), 1) child = result.children[0] self.assertEqual(child.entry, 4) self.assertEqual(child.exit, 4)
def testSESE0(self): G, head, tail = makeGraph(0) result = findCycleEquivalences(G, head, tail) self.assertEqual(result.entry, head) self.assertEqual(result.exit, tail) self.assertEqual(set(result.nodes), set((1, 16))) self.assertEqual(len(result.children), 4) for child in result.children: if child.entry == 2: self.assertEqual(child.exit, 8) elif child.entry == 9: self.assertEqual(child.exit, 9) elif child.entry == 10: self.assertEqual(child.exit, 14) elif child.entry == 15: self.assertEqual(child.exit, 15) else: self.fail()
def testSESE3(self): G, head, tail = makeGraph(3) result = findCycleEquivalences(G, head, tail) self.assertEqual(result.entry, head) self.assertEqual(result.exit, tail)