Skip to content

Commit 6dbabc9

Browse files
committed
tests/extmod/os_urandom.py: Add test for os.urandom.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 6b8bcb6 commit 6dbabc9

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/extmod/os_urandom.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Test os.urandom().
2+
3+
try:
4+
from os import urandom
5+
except ImportError:
6+
print("SKIP")
7+
raise SystemExit
8+
9+
for n in range(-2, 5, 1):
10+
try:
11+
r = urandom(n)
12+
print(n, type(r), len(r))
13+
except ValueError:
14+
print(n, "ValueError")

0 commit comments

Comments
 (0)