def test_complex_loops(self): # from straightenRV manpage self.assertEqual(None, aspath.deloop_as_path([1, 2, 3, 2, 3, 4])) self.assertEqual(None, aspath.deloop_as_path([1, 2, 3, 2, 4, 5, 4]))
def test_simple_loops(self): # from straightenRV manpage self.assertEqual([1, 2, 5], aspath.deloop_as_path([1, 2, 3, 2, 5]))
def test_nonloops(self): path = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] self.assertEqual(path, aspath.deloop_as_path(path))