def test_make_cycle_unmoved(self): """ test that unmoved elements are dropped """ l = [0, 1, 3, 2] cycles = ((3, 4), ) self.assertEqual(cycles, Perm.make_cycles(l))
def test_make_cycle_unmoved(self): """ test that unmoved elements are dropped """ l = [0,1,3,2] cycles = ((3,4),) self.assertEqual(cycles, Perm.make_cycles(l))
def test_make_cycle_double(self): """ test with multiple cycles """ l = [1, 0, 3, 2] cycles = ((1, 2), (3, 4)) self.assertEqual(cycles, Perm.make_cycles(l))
def test_make_cycle_double(self): """ test with multiple cycles """ l = [1,0,3,2] cycles = ((1,2),(3,4)) self.assertEqual(cycles, Perm.make_cycles(l))
def test_make_cycle_identity(self): """ test the cycle maker on the identity permutation """ l = [0] cycles = ((1, ), ) self.assertEqual(cycles, Perm.make_cycles(l))
def test_make_cycle(self): """ test turning a permuted list into its list representation """ cycles = ((1, 2, 3), ) l = [1, 2, 0] self.assertEqual(cycles, Perm.make_cycles(l))
def test_make_cycle_identity(self): """ test the cycle maker on the identity permutation """ l = [0] cycles = ((1,),) self.assertEqual(cycles, Perm.make_cycles(l))
def test_make_cycle(self): """ test turning a permuted list into its list representation """ cycles = ((1,2,3),) l = [1,2,0] self.assertEqual(cycles, Perm.make_cycles(l))