-
Notifications
You must be signed in to change notification settings - Fork 34
/
test_model2roms.py
34 lines (26 loc) · 1.2 KB
/
test_model2roms.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
import unittest
from datetime import datetime
import compile
import configM2R
class TestModel2roms(unittest.TestCase):
def setUp(self):
compile.compilefortran("gfortran")
self.configM2R = configM2R.Model2romsConfig()
self.assertIsNotNone(self.configM2R)
class TestConfigM2R(TestModel2roms):
def test_output_names(self):
self.assertTrue(self.configM2R.clim_name)
self.assertTrue(self.configM2R.init_name)
self.assertTrue(self.configM2R.bry_name)
def test_define_ocean_forcing_data_path_returns_correct(self):
self.configM2R.ocean_indata_type = "SODA3"
self.assertTrue(self.configM2R.define_ocean_forcing_data_path())
self.configM2R.ocean_indata_type = "GLORYS"
self.assertTrue(self.configM2R.define_ocean_forcing_data_path())
self.configM2R.ocean_indata_type = "SODA3_5DAY"
self.assertTrue(self.configM2R.define_ocean_forcing_data_path())
def test_define_ocean_forcing_data_path_returns_error_when_missing_dataset(self):
self.configM2R.ocean_indata_type = "not_valid"
self.assertEqual(self.configM2R.define_ocean_forcing_data_path(), KeyError)
if __name__ == "__main__":
unittest.main()