I can see at least four ways you can test this, but there are probably more.
- Test whether it generates the correct number of values for various inputs, including requests for very large numbers of random numbers.
- Test whether it behaves correctly when the number of values requested is negative.
- Test whether the flag
leading_zeroes
actually works as expected. - Seed the random number generator with a fixed value using
random.seed()
and then verify that the sequence is deterministic and matches the expected sequence. Note that this may be implementation-dependent, so this test may not be effective if your function is intended to run on different versions of Python.