def test_get_cmor_fname_meta_basic(cmip5_cmor_fname): meta = get_cmor_fname_meta(cmip5_cmor_fname) r = { 'variable_name': 'tas', 'mip_table': 'Amon', 'model': 'HADCM3', 'experiment': 'decadal1990', 'ensemble_member': 'r3i2p1', } for att, val in r.items(): assert meta[att] == r[att]
def test_get_cmor_fname_meta_extended(fname, expected): meta = get_cmor_fname_meta(fname) for att, val in expected.items(): assert meta[att] == val