def test_make_list_multiple3(self): """ this time the cycles overlap, a few more """ cycle = ((1, 2), (1, 2, 3), (1, 2, 3, 4)) #(1,3,4) l = [2, 1, 3, 0] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list_multiple(self): """ test that permutation with multiple cycles is handled properly """ cycle = ((1, 2), (3, 4)) l = [1, 0, 3, 2] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list_multiple2(self): """ this time the cycles overlap """ cycle = ((1, 2), (1, 2, 3)) #(2,3) l = [0, 2, 1] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list_identity(self): """ test that identity permutation is handled properly """ cycle = ((1, ), ) l = [0] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list_incoplete(self): """ test that permutation of only some of the elements is handled properly """ cycle = ((4, 5), ) l = [0, 1, 2, 4, 3] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list_multiple3(self): """ this time the cycles overlap, a few more """ cycle = ((1,2), (1,2,3), (1,2,3,4)) #(1,3,4) l = [2,1,3,0] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list(self): """ test making single cycle into permuted list """ cycle = ((1, 2, 3), ) l = [1, 2, 0] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list_multiple2(self): """ this time the cycles overlap """ cycle = ((1,2), (1,2,3)) #(2,3) l = [0,2,1] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list_multiple(self): """ test that permutation with multiple cycles is handled properly """ cycle = ((1,2), (3,4)) l = [1,0,3,2] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list_incoplete(self): """ test that permutation of only some of the elements is handled properly """ cycle = ((4,5),) l = [0,1,2,4,3] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list_identity(self): """ test that identity permutation is handled properly """ cycle = ((1,),) l = [0] self.assertEqual(l, Perm.make_list(cycle))
def test_make_list(self): """ test making single cycle into permuted list """ cycle = ((1,2,3),) l = [1,2,0] self.assertEqual(l, Perm.make_list(cycle))