diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2021-01-14 17:05:03 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2021-01-14 17:05:03 +0000 |
| commit | 89fd62b45c036eebd70f1831917f9f5a95839679 (patch) | |
| tree | 8f1894eb4dc7f22149b72b39b5e5cab8198f9a7d | |
| parent | Pass state as doubles (diff) | |
| download | SyncRNG-89fd62b45c036eebd70f1831917f9f5a95839679.tar.gz SyncRNG-89fd62b45c036eebd70f1831917f9f5a95839679.zip | |
code formatting
| -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() |
