MCPcopy Index your code
hub / github.com/python/cpython / test_choice

Method test_choice

Lib/test/test_secrets.py:62–66  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

60 self.assertTrue(0 <= n < 2**numbits, errmsg % (numbits, n))
61
62 def test_choice(self):
63 # Test choice.
64 items = [1, 2, 4, 8, 16, 32, 64]
65 for i in range(10):
66 self.assertTrue(secrets.choice(items) in items)
67
68 def test_randbelow(self):
69 # Test randbelow.

Callers

nothing calls this directly

Calls 2

assertTrueMethod · 0.80
choiceMethod · 0.80

Tested by

no test coverage detected