Exemplo n.º 1
0
 def test_shuffled_set_equivalence(self):
   self.assertEqual(set(random.random_shuffle(list("abcd"))), set("abcd"))
Exemplo n.º 2
0
 def test_shuffled(self):
   # The possibility of a collision is smaller as the size of the list
   # increases.
   self.assertNotEqual(random.random_shuffle(list(random.ALPHANUMERIC)),
                       list(random.ALPHANUMERIC))
   self.assertEqual(random.random_shuffle(["a"]), ["a"])
Exemplo n.º 3
0
 def test_shuffled_length(self):
   self.assertEqual(len(random.random_shuffle(list("abcd"))), 4)