diff options
author | Damien George <damien.p.george@gmail.com> | 2016-09-16 12:49:15 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-09-16 12:49:15 +1000 |
commit | 67a481360106e3dd45334b81471629defd4a9380 (patch) | |
tree | 4f318fc927bb7d011a795606e3c83565e3a721ce /tests/extmod/urandom_basic.py | |
parent | f84b3416187c8144fd92e52d97a655a133d725b2 (diff) | |
download | micropython-67a481360106e3dd45334b81471629defd4a9380.tar.gz micropython-67a481360106e3dd45334b81471629defd4a9380.zip |
tests/extmod/urandom: Add urandom tests for error cases.
Diffstat (limited to 'tests/extmod/urandom_basic.py')
-rw-r--r-- | tests/extmod/urandom_basic.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/extmod/urandom_basic.py b/tests/extmod/urandom_basic.py index 7e4d8bf34c..bf00035bd5 100644 --- a/tests/extmod/urandom_basic.py +++ b/tests/extmod/urandom_basic.py @@ -17,3 +17,9 @@ random.seed(1) r = random.getrandbits(16) random.seed(1) print(random.getrandbits(16) == r) + +# check that it throws an error for zero bits +try: + random.getrandbits(0) +except ValueError: + print('ValueError') |