Skip to content

Commit cb0ba63

Browse files
committed
Add a regression test for #709
1 parent 0415eae commit cb0ba63

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

xray/test/test_backends.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,13 @@ def test_open_encodings(self):
512512
if k in expected['time'].encoding)
513513
self.assertDictEqual(actual_encoding, expected['time'].encoding)
514514

515+
def test_dump_encodings(self):
516+
# regression test for #709
517+
ds = Dataset({'x': ('y', np.arange(10.0))})
518+
kwargs = dict(encoding={'x': {'zlib': True}})
519+
with self.roundtrip(ds, save_kwargs=kwargs) as actual:
520+
self.assertTrue(actual.x.encoding['zlib'])
521+
515522
def test_dump_and_open_encodings(self):
516523
# Create a netCDF file with explicit time units
517524
# and make sure it makes it into the encodings

0 commit comments

Comments
 (0)