Exemple #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')
         ]
     )
Exemple #2
0
 def test_one_item(self):
     self.assertEqual(list(permutations(['a'])), [('a',)])
Exemple #3
0
 def test_zero_items(self):
     self.assertEqual(list(permutations([])), [])