Skip to content

Commit

Permalink
Clarify testing sections for different attribute 'styles'.
Browse files Browse the repository at this point in the history
  • Loading branch information
pp-mo committed Oct 25, 2022
1 parent 9984c67 commit 2c95111
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/iris/tests/integration/test_netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,12 @@ def check_expected_results(
assert self.attrname in v.ncattrs()
assert v.getncattr(self.attrname) == value

#######################################################
# Tests on "user-style" attributes.
# This means any arbitrary attribute which a user might have added -- i.e. one with
# a name which is *not* recognised in the netCDF or CF conventions.
#

def test_usertype_single_global(self):
self.create_testcase(
attr_name="myname", # A generic "user" attribute with no special handling
Expand Down Expand Up @@ -1233,17 +1239,15 @@ def test_usertype_nonmatching_remainlocal(self):
var_attr_vals={"v1": "value-1", "v2": "value-2"},
)

# #####################################
# # WIP ...
# # We have a number of different "classes" of recognised attributes which are
# # handled differently.
# # We may not test all cases, but only one of each "class". Or we might be able
# # to do them all (not yet clear how).
#######################################################
# Tests on "Conventions" attribute.
# Note: the usual 'Conventions' behaviour is already tested elsewhere
# - see :class:`TestConventionsAttributes` above
#
# TODO: the name 'conventions' (lower-case) is also listed in _CF_GLOBAL_ATTRS, but
# we have excluded it from the global-attrs testing here. We probably still need to
# test what that does, though it's inclusion might simply be a mistake.
#
# #####################################
# # === "Conventions" === - which is a case to itself
# # Note: the usual 'Conventions' behaviour is already tested elsewhere
# # - see TestConventionsAttributes above

def test_conventions_var_local(self):
# What happens if 'Conventions' appears as a variable-local attribute.
Expand Down

0 comments on commit 2c95111

Please sign in to comment.