diff --git a/compliance_checker/tests/test_cf.py b/compliance_checker/tests/test_cf.py index f0222a25..51b7dc34 100644 --- a/compliance_checker/tests/test_cf.py +++ b/compliance_checker/tests/test_cf.py @@ -132,6 +132,7 @@ def test_check_data_types(self): """ # TEST CONFORMANCE 2.2 REQUIRED + # TODO: Check 1D char array # check default netCDF data types dataset = self.load_dataset(STATIC_FILES["rutgers"]) @@ -366,7 +367,7 @@ def test_check_conventions_are_cf_16(self): ยง2.6.1 the NUG defined global attribute Conventions to the string value "CF-1.6" """ - # CONFORMANCE 2.6.1 REQUIRED + # TEST CONFORMANCE 2.6.1 REQUIRED # Note: conformance doc for 1.6 mentions CF-1.5 # :Conventions = "CF-1.6" dataset = self.load_dataset(STATIC_FILES["rutgers"]) @@ -479,6 +480,7 @@ def test_check_standard_name(self): dataset = MockTimeSeries() temperature = dataset.createVariable("temperature", "f8", ("time",)) + temperature.standard_name = "sea_water_temperature" temperature.ancillary_variables = "temperature_flag" temperature_flag = dataset.createVariable("temperature_flag", "i2", ("time",)) @@ -492,6 +494,13 @@ def test_check_standard_name(self): temperature_flag.units = "1" _, _, messages = get_results(self.cf.check_standard_name(dataset)) + # TEST CONFORMANCE 3 RECOMMENDED + # long_name or standard_name present + del temperature.standard_name + _, _, messages = get_results(self.cf.check_standard_name(dataset)) + assert ("Attribute long_name or/and standard_name is highly " + "recommended for variable temperature" in messages) + def test_cell_bounds(self): dataset = self.load_dataset(STATIC_FILES["grid-boundaries"]) results = self.cf.check_cell_boundaries(dataset)