Debian Codegraph @

rpython/rlib/test/test_rurandom.py

raw symbols SCIP
1 import py
2 from rpython.rlib import rurandom
3
4 def test_rurandom():
5 n = 5000
6 s = rurandom.urandom(n)
7 assert type(s) is str and len(s) == n
8 for x in [1, 11, 111, 222]:
9 assert s.count(chr(x)) >= 1
10
11 @py.test.mark.skipif("sys.platform == 'win32'")
12 def test_rurandom_no_syscall(monkeypatch):
13 monkeypatch.setattr(rurandom, 'SYS_getrandom', None)
14 test_rurandom()