From 19b7001fa0d04e21fc3846ca0b234a6d769db01d Mon Sep 17 00:00:00 2001 From: lbdreyer Date: Thu, 20 Feb 2020 18:42:35 +0000 Subject: [PATCH 1/2] Remove uri callback test which is moved to iris-grib --- .../results/uri_callback/grib_global.cml | 60 ------------------- lib/iris/tests/test_uri_callback.py | 28 --------- 2 files changed, 88 deletions(-) delete mode 100644 lib/iris/tests/results/uri_callback/grib_global.cml diff --git a/lib/iris/tests/results/uri_callback/grib_global.cml b/lib/iris/tests/results/uri_callback/grib_global.cml deleted file mode 100644 index aef0310a96..0000000000 --- a/lib/iris/tests/results/uri_callback/grib_global.cml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/iris/tests/test_uri_callback.py b/lib/iris/tests/test_uri_callback.py index 16bccb7a09..3e644c4df7 100644 --- a/lib/iris/tests/test_uri_callback.py +++ b/lib/iris/tests/test_uri_callback.py @@ -9,37 +9,9 @@ import os -import iris.coords - @tests.skip_data class TestCallbacks(tests.IrisTest): - @tests.skip_grib - def test_grib_callback(self): - def grib_thing_getter(cube, field, filename): - if hasattr(field, "sections"): - # New-style loader callback : 'field' is a GribMessage, which has 'sections'. - cube.add_aux_coord( - iris.coords.AuxCoord( - field.sections[1]["year"], - long_name="extra_year_number_coord", - units="no_unit", - ) - ) - else: - # Old-style loader provides 'GribWrapper' type field. - cube.add_aux_coord( - iris.coords.AuxCoord( - field.extra_keys["_periodStartDateTime"], - long_name="random element", - units="no_unit", - ) - ) - - fname = tests.get_data_path(("GRIB", "global_t", "global.grib2")) - cube = iris.load_cube(fname, callback=grib_thing_getter) - self.assertCML(cube, ["uri_callback", "grib_global.cml"]) - def test_pp_callback(self): def pp_callback(cube, field, filename): cube.attributes["filename"] = os.path.basename(filename) From 9bdd0d371c5bcf44a8ab6d3f3a01f69f958cd87f Mon Sep 17 00:00:00 2001 From: lbdreyer Date: Thu, 20 Feb 2020 19:06:05 +0000 Subject: [PATCH 2/2] Add an iris import --- lib/iris/tests/test_uri_callback.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/iris/tests/test_uri_callback.py b/lib/iris/tests/test_uri_callback.py index 3e644c4df7..b428a1b561 100644 --- a/lib/iris/tests/test_uri_callback.py +++ b/lib/iris/tests/test_uri_callback.py @@ -9,6 +9,8 @@ import os +import iris + @tests.skip_data class TestCallbacks(tests.IrisTest):