def test_rename_dir(self): path = self.temp_path("a/b/c") fsutil.make_dirs(path) fsutil.rename_dir(path, "d") self.assertFalse(fsutil.exists(path)) path = self.temp_path("a/b/d") self.assertTrue(fsutil.exists(path))
def test_rename_dir(self): path = self.temp_path('a/b/c') fsutil.make_dirs(path) fsutil.rename_dir(path, 'd') self.assertFalse(fsutil.exists(path)) path = self.temp_path('a/b/d') self.assertTrue(fsutil.exists(path))
def test_rename_dir_with_existing_name(self): path = self.temp_path("a/b/c") fsutil.make_dirs(path) fsutil.make_dirs(self.temp_path("a/b/d")) with self.assertRaises(OSError): fsutil.rename_dir(path, "d")
def test_make_dirs_with_existing_file(self): path = self.temp_path("a/b/c.txt") fsutil.create_file(path) with self.assertRaises(OSError): fsutil.make_dirs(path)
def test_make_dirs_with_existing_dir(self): path = self.temp_path("a/b/c/") fsutil.create_dir(path) fsutil.make_dirs(path) self.assertTrue(fsutil.is_dir(path))
def test_make_dirs(self): path = self.temp_path("a/b/c/") fsutil.make_dirs(path) self.assertTrue(fsutil.is_dir(path))