diff options
| -rw-r--r-- | tests/test.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/test.py b/tests/test.py index 1d7ec21..d217f80 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,12 +1,12 @@ +# -*- coding: utf-8 -*- -from __future__ import division import unittest from SyncRNG import SyncRNG -class SyncRNGTestCase(unittest.TestCase): +class SyncRNGTestCase(unittest.TestCase): def test_randi(self): s = SyncRNG(seed=123456) self.assertEqual(s.randi(), 959852049) @@ -17,11 +17,11 @@ class SyncRNGTestCase(unittest.TestCase): def test_rand(self): s = SyncRNG(seed=123456) - self.assertAlmostEqual(s.rand(), 959852049/pow(2, 32)) - self.assertAlmostEqual(s.rand(), 2314333085/pow(2, 32)) - self.assertAlmostEqual(s.rand(), 2255782734/pow(2, 32)) - self.assertAlmostEqual(s.rand(), 2921461239/pow(2, 32)) - self.assertAlmostEqual(s.rand(), 1024197102/pow(2, 32)) + self.assertAlmostEqual(s.rand(), 959852049 / pow(2, 32)) + self.assertAlmostEqual(s.rand(), 2314333085 / pow(2, 32)) + self.assertAlmostEqual(s.rand(), 2255782734 / pow(2, 32)) + self.assertAlmostEqual(s.rand(), 2921461239 / pow(2, 32)) + self.assertAlmostEqual(s.rand(), 1024197102 / pow(2, 32)) def test_randbelow(self): s = SyncRNG(seed=123456) @@ -44,5 +44,6 @@ class SyncRNGTestCase(unittest.TestCase): exp = int(line.strip()) self.assertTrue(exp == s.randi()) -if __name__ == '__main__': + +if __name__ == "__main__": unittest.main() |
