Skip to content

Commit

Permalink
add test one of the years in extarct_time input is None
Browse files Browse the repository at this point in the history
  • Loading branch information
Elizaveta Malinina committed Jul 24, 2024
1 parent 494fc5f commit cd9c6e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/unit/preprocessor/_time/test_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ def test_extract_time_no_time(self):
cube = _create_sample_cube()[0]
sliced = extract_time(cube, 1950, 1, 1, 1950, 12, 31)
assert cube == sliced

def test_extract_time_none_year(self):
"""Test extract_time when one of the years is None."""
cube = self.cube.coord('time').guess_bounds()
with assert_raises(ValueError):
extract_time(cube, None, 1, 1, 1950, 2, 1)



class TestClipTimerange(tests.Test):
Expand Down

0 comments on commit cd9c6e6

Please sign in to comment.