def test_truncating(self): self._create_files() f = create_files(self.filename,self.split_size,overwrite=True) for f in self._get_files(): if firstexp.match(os.path.split(f)[1]): self.assertTrue(os.stat(f).st_size != 0) else: self.assertTrue(os.stat(f).st_size == 0)
def _create_files(self,ov=False): """ Private utility function which creates the file family filled with data. """ f = create_files(self.filename,self.split_size,overwrite=ov) g = f.root(); d = g.create_field("data","uint64",shape=(0,self.nx,self.ny)) self._fill_with_data(f,d) f.close()
def setUp(self): f = create_files(self.full_path,self.split_size,overwrite=True) f.close()