@@ -384,6 +384,14 @@ def test_encoding_kwarg(self):
384
384
with self .roundtrip (ds , save_kwargs = kwargs ) as actual :
385
385
pass
386
386
387
+ ds = Dataset ({'t' : pd .date_range ('2000-01-01' , periods = 3 )})
388
+ units = 'days since 1900-01-01'
389
+ kwargs = dict (encoding = {'t' : {'units' : units }})
390
+ with self .roundtrip (ds , save_kwargs = kwargs ) as actual :
391
+ self .assertEqual (actual .t .encoding ['units' ], units )
392
+ self .assertDatasetIdentical (actual , ds )
393
+
394
+
387
395
_counter = itertools .count ()
388
396
389
397
@@ -504,13 +512,6 @@ def test_open_encodings(self):
504
512
if k in expected ['time' ].encoding )
505
513
self .assertDictEqual (actual_encoding , expected ['time' ].encoding )
506
514
507
- def test_dump_encodings (self ):
508
- # regression test for #709
509
- ds = Dataset ({'x' : ('y' , np .arange (10.0 ))})
510
- kwargs = dict (encoding = {'x' : {'zlib' : True }})
511
- with self .roundtrip (ds , save_kwargs = kwargs ) as actual :
512
- self .assertTrue (actual .x .encoding ['zlib' ])
513
-
514
515
def test_dump_and_open_encodings (self ):
515
516
# Create a netCDF file with explicit time units
516
517
# and make sure it makes it into the encodings
0 commit comments