def test_not_ground(tmp_folder): ground = Ground.settle(tmp_folder, 'test_ground') folder = Folder(ground) g = folder.list('.*')[0] c = g.list()[0] cf = File(c.list('.*')[0]) dic = cf.read() dic['ground_key'] = 'rubbish' cf.write(dic) with pytest.raises(NoGround): Ground(tmp_folder) cf.delete() with pytest.raises(NotRootException): Ground(tmp_folder)
def _files(self, pattern='*', recursive=True): paths = self._folder.files(pattern=pattern, recursive=recursive) return [File(x) for x in paths]