def test_frt_coord_invalid_bounds(reliability_cube, overlapping_frt): """Test that an exception is raised if the input cubes have forecast reference time bounds that overlap.""" plugin = Plugin() msg = "Reliability calibration tables have overlapping" with pytest.raises(ValueError, match=msg): plugin._check_frt_coord([reliability_cube, overlapping_frt])
def test_invalid_bounds(self): """Test that an exception is raised if the input cubes have forecast reference time bounds that overlap.""" plugin = Plugin() msg = "Reliability calibration tables have overlapping" with self.assertRaisesRegex(ValueError, msg): plugin._check_frt_coord([self.reliability_cube, self.overlapping_frt])
def test_matching_bounds(self): """Test that no exception is raised in the input cubes if a cube contains matching bounds.""" lower_bound = self.reliability_cube.coord( "forecast_reference_time").bounds[0][0] self.reliability_cube.coord("forecast_reference_time").bounds = [[ lower_bound, lower_bound ]] plugin = Plugin() plugin._check_frt_coord([self.reliability_cube, self.different_frt])
def test_valid_bounds(self): """Test that no exception is raised if the input cubes have forecast reference time bounds that do not overlap.""" plugin = Plugin() plugin._check_frt_coord([self.reliability_cube, self.different_frt])