Skip to content

Commit ac4144d

Browse files
committed
add test
1 parent 1fb8008 commit ac4144d

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

obsarray/templater/tests/test_dataset_util.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,36 @@ def test_create_variable_3D_int_attributes(self):
173173
self.assertEqual(-127, array_variable[2, 4, 2])
174174
self.assertEqual("std", array_variable.attrs["standard_name"])
175175

176-
def test_create_unc_variable(self):
176+
def test_create_unc_variable_1dimundef(self):
177+
err_corr = [
178+
{
179+
"dim": ["x"],
180+
"form": "rectangle_absolute",
181+
"params": [1, 2],
182+
"units": ["m", "m"],
183+
},
184+
]
185+
186+
unc_variable = DatasetUtil.create_unc_variable(
187+
[7],
188+
np.int8,
189+
["x"],
190+
pdf_shape="gaussian",
191+
err_corr=err_corr,
192+
)
193+
194+
expected_attrs = {
195+
"err_corr_1_dim": "x",
196+
"err_corr_1_form": "rectangle_absolute",
197+
"err_corr_1_units": ["m", "m"],
198+
"err_corr_1_params": [1, 2],
199+
}
200+
201+
actual_attrs = unc_variable.attrs
202+
203+
self.assertTrue(expected_attrs.items() <= actual_attrs.items())
204+
205+
def test_create_unc_variable_1undef(self):
177206
err_corr = [
178207
{
179208
"dim": "x",

0 commit comments

Comments
 (0)