示例#1
0
 def test_dict(self):
     data = {1:'one', 'two': 2, 'tree': [1,2,'three']}
     foo = Foo(data)
     with h5tmp() as f:
         writer = Writer(f)
         writer.yaml('data', data=data)
         reader = Reader(f)
         data_bis = reader.yaml('data')
         self.assertDictEqual(data, data_bis)
示例#2
0
 def test_dict(self):
     data = {1:'one', 'two': 2, 'tree': [1,2,'three']}
     foo = Foo(data)
     bar = Bar()
     with h5tmp() as f:
         writer = Writer(f, from_object=foo)
         writer.yaml('data')
         reader = Reader(f, to_object=bar)
         reader.yaml('data')
         self.assertDictEqual(foo.data, bar.data)
示例#3
0
 def test_dict(self):
     data = {1:'one', 'two': 2, 'tree': [1,2,'three']}
     foo = {'data': data}
     bar = {}
     with h5tmp() as f:
         writer = Writer(f, from_dict=foo)
         writer.yaml('data')
         reader = Reader(f, to_dict=bar)
         data_bis = reader.yaml('data')
         self.assertDictEqual(data, data_bis)