def test_do_listdir_err(self): try: path = os.path.join('/tmp', str(random.random())) fs.do_listdir(path) except GlusterFileSystemOSError: pass else: self.fail("GlusterFileSystemOSError expected")
def test_do_listdir(self): tmpdir = mkdtemp() try: subdir = [] for i in range(5): subdir.append(mkdtemp(dir=tmpdir).rsplit(os.path.sep, 1)[1]) assert subdir.sort() == fs.do_listdir(tmpdir).sort() finally: shutil.rmtree(tmpdir)