def test_cube_var_name_is_none(self): """ Test that the utility returns an iris.cube.Cube with a var_name of None. """ self.cube.var_name = "air_temperature" result = _strip_var_names(self.cube) self.assertIsNone(result[0].var_name, None)
def test_cubelist(self): """Test that the utility returns an iris.cube.CubeList.""" cube1 = self.cube cube2 = self.cube cubes = iris.cube.CubeList([cube1, cube2]) self.cube.var_name = "air_temperature" result = _strip_var_names(cubes) self.assertIsInstance(result, iris.cube.CubeList) for cube in result: for coord in cube.coords(): self.assertIsNone(coord.var_name, None)
def test_cube_coord_var_name_is_none(self): """ Test that the coordinates have var_names of None. """ self.cube.coord("time").var_name = "time" self.cube.coord("latitude").var_name = "latitude" self.cube.coord("longitude").var_name = "longitude" result = _strip_var_names(self.cube) for cube in result: for coord in cube.coords(): self.assertIsNone(coord.var_name, None)
def test_basic(self): """Test that the utility returns an iris.cube.CubeList.""" self.cube.var_name = "air_temperature" result = _strip_var_names(self.cube) self.assertIsInstance(result, iris.cube.CubeList)