From 302c7be86783edf8269299650d4f30ea171e33a0 Mon Sep 17 00:00:00 2001 From: danielfromearth Date: Fri, 13 Dec 2024 14:47:28 -0500 Subject: [PATCH] add test that asserts `compare` returns 0 when comparing a netCDF file to itself. --- tests/test_core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_core.py b/tests/test_core.py index 2c35f5c..b8595d2 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -71,6 +71,10 @@ def test_no_error_compare_2groupsTo1Subgroup( compare_ba(ds_3dims_3vars_4coords_2groups, ds_3dims_3vars_4coords_1subgroup) +def test_zero_for_comparison_with_no_differences(ds_3dims_3vars_4coords_1subgroup): + assert compare(ds_3dims_3vars_4coords_1subgroup, ds_3dims_3vars_4coords_1subgroup) == 0 + + def test_var_properties(ds_3dims_3vars_4coords_1group): with nc.Dataset(ds_3dims_3vars_4coords_1group) as ds: result = _var_properties(ds.groups["Group1"], varname="step")