Skip to content

Commit

Permalink
Added unit tests for single point and no points
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Benfold committed Nov 26, 2021
1 parent 5c90bdd commit 04b388d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/iris/tests/unit/util/test__coord_regular.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ def test_irregular_points(self):
self.assertEqual(exp_avdiff, result_avdiff)
self.assertFalse(result)

def test_single_point(self):
lone_point = np.array([4])
result_avdiff, result = points_step(lone_point)
self.assertTrue(np.isnan(result_avdiff))
self.assertTrue(result)

def test_no_points(self):
no_points = np.array([])
result_avdiff, result = points_step(no_points)
self.assertTrue(np.isnan(result_avdiff))
self.assertTrue(result)


if __name__ == "__main__":
tests.main()

0 comments on commit 04b388d

Please sign in to comment.