File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1330,6 +1330,27 @@ def test_annotations_special_cases(self):
13301330
13311331 # TODO: multi dimensional value (GH Issue #501)
13321332
1333+ def test_annotation_types (self ):
1334+ annotations = {
1335+ "somedate" : self .rdate (),
1336+ "somequantity" : self .rquant (10 , pq .ms ),
1337+ "somestring" : self .rsentence (3 ),
1338+ "somebytes" : bytes (self .rsentence (4 ), "utf8" ),
1339+ "npfloat" : np .float (10 ),
1340+ "nparray" : np .array ([1 , 2 , 400 ]),
1341+ "emptystr" : "" ,
1342+ }
1343+ wblock = Block ("annotation_block" , ** annotations )
1344+ self .writer .write_block (wblock )
1345+ rblock = self .writer .read_block (neoname = "annotation_block" )
1346+ for k in annotations :
1347+ orig = annotations [k ]
1348+ readval = rblock .annotations [k ]
1349+ if isinstance (orig , np .ndarray ):
1350+ np .testing .assert_almost_equal (orig , readval )
1351+ else :
1352+ self .assertEqual (annotations [k ], rblock .annotations [k ])
1353+
13331354
13341355@unittest .skipUnless (HAVE_NIX , "Requires NIX" )
13351356class NixIOReadTest (NixIOTest ):
You can’t perform that action at this time.
0 commit comments