예제 #1
0
 def test_three_items(self):
     items = ['a', 'b', 'c']
     self.assertEqual(
         list(permutations(items)),
         [
             ('a', 'b', 'c'), ('a', 'c', 'b'), ('b', 'a', 'c'),
             ('b', 'c', 'a'), ('c', 'a', 'b'), ('c', 'b', 'a')
         ]
     )
예제 #2
0
 def test_one_item(self):
     self.assertEqual(list(permutations(['a'])), [('a',)])
예제 #3
0
 def test_zero_items(self):
     self.assertEqual(list(permutations([])), [])