Пример #1
0
    def test_append(self):
        self.items.create_dataset(self.group, 10)
        writed = self.group[self.items.name]
        assert len(writed[...]) == 0

        self.items.write(self.group)
        assert len(writed[...]) == 10

        self.items.write(self.group)
        assert len(writed[...]) == 20

        items2 = Items(generate.items(5))
        items2.write(self.group)
        assert len(writed[...]) == 25

        del self.group[self.items.name]
        self.items.create_dataset(self.group, 10)
        assert len(self.group[self.items.name][...]) == 0
Пример #2
0
 def setup(self):
     self.filename = 'test.h5'
     self.items = Items(generate.items(10))
     self.h5file = h5py.File(self.filename)
Пример #3
0
 def setup(self):
     self.filename = 'test.h5'
     self.group = h5py.File(self.filename, 'w').create_group('group')
     self.items = Items(generate.items(10))