def test_no_realization(self): cube = stock.simple_pp() grib = mock.Mock() mock_gribapi = mock.Mock(spec=gribapi) with mock.patch(GRIB_API, mock_gribapi): identification(cube, grib) mock_gribapi.assert_has_calls([mock.call.grib_set_long(grib, "typeOfProcessedData", 2)])
def test_no_realization(self): cube = stock.simple_pp() grib = mock.Mock() mock_gribapi = mock.Mock(spec=gribapi) with mock.patch(GRIB_API, mock_gribapi): identification(cube, grib) mock_gribapi.assert_has_calls( [mock.call.grib_set_long(grib, "typeOfProcessedData", 2)])
def test_realization_n(self): cube = stock.simple_pp() realisation = iris.coords.AuxCoord((2,), standard_name="realization", units="1") cube.add_aux_coord(realisation) grib = mock.Mock() mock_gribapi = mock.Mock(spec=gribapi) with mock.patch(GRIB_API, mock_gribapi): identification(cube, grib) mock_gribapi.assert_has_calls([mock.call.grib_set_long(grib, "typeOfProcessedData", 4)])
def test_realization_n(self): cube = stock.simple_pp() realisation = iris.coords.AuxCoord((2,), standard_name='realization', units='1') cube.add_aux_coord(realisation) grib = mock.Mock() mock_gribapi = mock.Mock(spec=gribapi) with mock.patch(GRIB_API, mock_gribapi): identification(cube, grib) mock_gribapi.assert_has_calls( [mock.call.grib_set_long(grib, "typeOfProcessedData", 4)])