Skip to content

Commit

Permalink
Fixing tests (#66)
Browse files Browse the repository at this point in the history
* Fixing fabm0d tests

* Fixing aquarium tests

* Update profiling test csv file
  • Loading branch information
Michael Wathen authored Mar 30, 2022
1 parent f361ba6 commit 373b142
Show file tree
Hide file tree
Showing 3 changed files with 706 additions and 680 deletions.
2 changes: 1 addition & 1 deletion github-actions/fabm0d-gotm-ersem/expected.json

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions github-actions/fabm0d-gotm-ersem/test_aquarium.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import aquarium_tut


class AquariumTests(unittest.TestCase):
"""
Aquarium 0D model tests
Expand All @@ -28,6 +29,7 @@ def setUp(self, mock_show):
self.expected = json.load(fp)
self.value_dict = aquarium_tut.main(self.model_path)


def test_dates_value(self):
"""
Checks the dates (dates) values are the same
Expand All @@ -41,46 +43,46 @@ def test_light_value(self):
values are the same
"""
name = "light_parEIR"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_temp_value(self):
"""
Checks the temp (temp) values are the same
"""
name = "temp"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_salt_value(self):
"""
Checks the salinity (salt) values are the same
"""
name = "salt"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_phosphorus_value(self):
"""
Checks the phosphate phosphorus (N1_p) values are the same
"""
name = "N1_p"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_nitrogen_value(self):
"""
Checks the nitrate nitrogen (N3_n) values are the same
"""
name = "N3_n"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_bcarbon_value(self):
"""
Checks the bacteria carbon (B1_c) values are the same
"""
name = "B1_c"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])

def test_ncarbon_value(self):
"""
Checks the nanophytoplankton carbon (P2_c) values are the same
"""
name = "B1_c"
assert np.array_equal(self.expected[name], self.value_dict[name])
assert np.allclose(self.expected[name], self.value_dict[name])
Loading

0 comments on commit 373b142

Please sign in to comment.