@@ -62,6 +62,83 @@ def test_builder_build(
62
62
assert len (cat ) == num_datasets
63
63
64
64
65
+ @pytest .mark .parametrize (
66
+ "filename, builder, realm, member, file_id" ,
67
+ [
68
+ (
69
+ "access-om2/output000/ocean/ocean.nc" ,
70
+ "AccessOm2Builder" ,
71
+ "ocean" ,
72
+ None ,
73
+ "ocean" ,
74
+ ),
75
+ (
76
+ "access-om2/output000/ice/OUTPUT/iceh.1900-01.nc" ,
77
+ "AccessOm2Builder" ,
78
+ "seaIce" ,
79
+ None ,
80
+ "iceh_XXXX_XX" ,
81
+ ),
82
+ (
83
+ "access-cm2/by578/history/atm/netCDF/by578a.pd201501_dai.nc" ,
84
+ "AccessCm2Builder" ,
85
+ "atmos" ,
86
+ "by578" ,
87
+ "a_pdXXXXXX_dai" ,
88
+ ),
89
+ (
90
+ "access-cm2/by578a/history/atm/netCDF/by578aa.pd201501_dai.nc" ,
91
+ "AccessCm2Builder" ,
92
+ "atmos" ,
93
+ "by578a" ,
94
+ "a_pdXXXXXX_dai" ,
95
+ ),
96
+ (
97
+ "access-cm2/by578/history/ice/iceh_d.2015-01.nc" ,
98
+ "AccessCm2Builder" ,
99
+ "seaIce" ,
100
+ "by578" ,
101
+ "iceh_d_XXXX_XX" ,
102
+ ),
103
+ (
104
+ "access-cm2/by578/history/ocn/ocean_daily.nc-20150630" ,
105
+ "AccessCm2Builder" ,
106
+ "ocean" ,
107
+ "by578" ,
108
+ "ocean_daily" ,
109
+ ),
110
+ (
111
+ "access-om3/output000/GMOM_JRA_WD.mom6.h.sfc_1900_01_02.nc" ,
112
+ "AccessOm3Builder" ,
113
+ "ocean" ,
114
+ None ,
115
+ "GMOM_JRA_WD_mom6_h_sfc_XXXX_XX_XX" ,
116
+ ),
117
+ (
118
+ "access-om3/output000/GMOM_JRA_WD.cice.h.1900-01-01.nc" ,
119
+ "AccessOm3Builder" ,
120
+ "seaIce" ,
121
+ None ,
122
+ "GMOM_JRA_WD_cice_h_XXXX_XX_XX" ,
123
+ ),
124
+ (
125
+ "access-om3/output000/GMOM_JRA_WD.ww3.hi.1900-01-02-00000.nc" ,
126
+ "AccessOm3Builder" ,
127
+ "wave" ,
128
+ None ,
129
+ "GMOM_JRA_WD_ww3_hi_XXXX_XX_XX_XXXXX" ,
130
+ ),
131
+ ],
132
+ )
133
+ def test_builder_parser (test_data , filename , builder , realm , member , file_id ):
134
+ Builder = getattr (builders , builder )
135
+ info = Builder .parser (str (test_data / filename ))
136
+ assert info ["realm" ] == realm
137
+ if member :
138
+ assert info ["member" ] == member
139
+ assert info ["file_id" ] == file_id
140
+
141
+
65
142
def test_builder_columns_with_iterables (test_data ):
66
143
builder = builders .AccessOm2Builder (str (test_data / "access-om2" ))
67
144
assert not builder .columns_with_iterables
0 commit comments