コード例 #1
0
 def test_length_one(self):
     self.assertEqual(permutations('1'), ['1'])
コード例 #2
0
 def test_really_long(self):
     self.assertEqual(
         set(permutations('ABCDEFGH')),
         set([''.join(p) for p in itertools.permutations('ABCDEFGH')])
     )
コード例 #3
0
 def test_length_three(self):
     self.assertEqual(
         permutations('123'),
         ['123', '132', '213', '231', '321', '312']
     )
コード例 #4
0
 def test_length_three_repeated(self):
     self.assertEqual(
         permutations('111'),
         ['111'] * 6
     )
コード例 #5
0
 def test_length_two(self):
     self.assertEqual(permutations('12'), ['12', '21'])