forked from ET-NCMP/MarineQC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_CalcHums.py
57 lines (45 loc) · 1.37 KB
/
test_CalcHums.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import unittest
import CalcHums as ch
class Test_humidity_functions(unittest.TestCase):
def test_vap_from_example(self):
"""
This is from Kate's example in the file
"""
self.assertEqual(ch.vap(10., 15., 1013), 12.3)
def test_vap_from_sh(self):
"""
This is from Kate's example in the file
"""
self.assertEqual(ch.vap_from_sh(7.6, 1013.), 12.3)
def test_sh(self):
"""
This is from Kate's example in the file
"""
self.assertEqual(ch.sh(10., 15., 1013.), 7.6)
def test_sh_from_vap(self):
"""
This is from Kate's example in the file
"""
# self.assertEqual(ch.sh_from_vap(10.,15.,1013.), 7.6)
def test_rh(self):
"""
This is from Kate's example in the file
"""
self.assertEqual(ch.rh(10., 15., 1013.), 72.0)
def test_wb(self):
"""
This is from Kate's example in the file
"""
self.assertEqual(ch.wb(10., 15., 1013), 12.2)
def test_dpd(self):
"""
This is from Kate's example in the file
"""
self.assertEqual(ch.dpd(10., 15.), 5.0)
def test_td_from_vap(self):
"""
They're all from Kate's examples in the file
"""
self.assertEqual(ch.td_from_vap(12.3, 1013., 15.), 10.0)
if __name__ == '__main__':
unittest.main()