summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-08-29 15:46:35 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-08-29 15:46:35 (GMT)
commitdc3883f671893fe338ecbd25e84316728c6c48b9 (patch)
tree1c6a79019126d16b7c96c3e37354e131a529e235 /Lib/test/test_os.py
parent6ab78cd0c055462af4f5a6c59b9f310a83734c45 (diff)
downloadcpython-dc3883f671893fe338ecbd25e84316728c6c48b9.zip
cpython-dc3883f671893fe338ecbd25e84316728c6c48b9.tar.gz
cpython-dc3883f671893fe338ecbd25e84316728c6c48b9.tar.bz2
Patch #934711: Expose platform-specific entropy.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 22cd112..a9668aa 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -343,6 +343,16 @@ class DevNullTests (unittest.TestCase):
self.assertEqual(f.read(), '')
f.close()
+class URandomTests (unittest.TestCase):
+ def test_urandom(self):
+ try:
+ self.assertEqual(len(os.urandom(1)), 1)
+ self.assertEqual(len(os.urandom(10)), 10)
+ self.assertEqual(len(os.urandom(100)), 100)
+ self.assertEqual(len(os.urandom(1000)), 1000)
+ except NotImplementedError:
+ pass
+
def test_main():
test_support.run_unittest(
TemporaryFileTests,
@@ -351,6 +361,7 @@ def test_main():
WalkTests,
MakedirTests,
DevNullTests,
+ URandomTests
)
if __name__ == "__main__":