def test_directory(self): init() move_to(dir1, dir2) move_to(dir1, dir2, ignore=True) mkdir(dir1) move_to(dir1, dir2, force=True) assert os.path.exists(dir1) == False assert os.path.exists(dir2_dir1) == True
def test_FileExistsError(self): init() with raises(FileExistsError): mkdir(test_porter) init() with raises(FileExistsError): copy(dir1_f1, dir2_f2) init() with raises(FileExistsError): copy(dir1, dir2)
def test_directory(self): init() move(dir1, dir2_dir1) assert not os.path.exists(dir1) assert os.path.exists(dir2_dir1) mkdir(dir1) move(dir1, dir2_dir1, ignore=True) assert not os.path.exists(dir1) assert os.path.exists(dir2_dir1) mkdir(dir1) move(dir1, dir2_dir1, force=True) assert not os.path.exists(dir1) assert os.path.exists(dir2_dir1)
def test_mkdir(): init() mkdir(dir_mkdir) assert os.path.exists(dir_mkdir) mkdir(dir_mkdir, ignore=True) assert os.path.exists(dir_mkdir) mkdir(dir_mkdir, force=True) assert os.path.exists(dir_mkdir)
def init(): mkdir(test_porter, force=True) mkdir(dir1) mkdir(dir2) create(dir1_f1) create(dir2_f2)