-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
31 lines (23 loc) · 761 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import unittest
import sys
try:
if '--include_this_directory' in sys.argv:
raise Exception('Avoiding removing current directory from sys.path')
if '.' in sys.path:
sys.path.remove('.')
if '' in sys.path:
sys.path.remove('')
except:
pass
import quake_inverse_sq
class TestCase(unittest.TestCase):
def test_coarse_invert_squareroot(self) -> None:
EXPECT = 0.49915357479239103
INPUT = 4
self.assertAlmostEqual(quake_inverse_sq.coarse_inv_sqrt(INPUT), EXPECT)
def test_fined_invert_squareroot(self) -> None:
EXPECT = 0.5
INPUT = 4
self.assertAlmostEqual(quake_inverse_sq.fined_inv_sqrt(INPUT), EXPECT)
if __name__ == '__main__':
unittest.main()