SF #1027105: HardwareRandom should be renamed OSRandom

Renamed the new generator at Trevor's recommendation.
The name HardwareRandom suggested a bit more than it
delivered (no radioactive decay detectors or such).
This commit is contained in:
Raymond Hettinger 2004-09-13 22:23:21 +00:00
parent 3e773fb622
commit 23f1241dc6
3 changed files with 24 additions and 20 deletions

View file

@ -164,8 +164,8 @@ class WichmannHill_TestBasicOps(TestBasicOps):
self.assertRaises(UserWarning, self.gen.randrange, 2**60)
warnings.filters[:] = oldfilters
class HardwareRandom_TestBasicOps(TestBasicOps):
gen = random.HardwareRandom()
class SystemRandom_TestBasicOps(TestBasicOps):
gen = random.SystemRandom()
def test_autoseed(self):
# Doesn't need to do anything except not fail
@ -496,11 +496,11 @@ def test_main(verbose=None):
TestModule]
try:
random.HardwareRandom().random()
random.SystemRandom().random()
except NotImplementedError:
pass
else:
testclasses.append(HardwareRandom_TestBasicOps)
testclasses.append(SystemRandom_TestBasicOps)
test_support.run_unittest(*testclasses)