예제 #1
0
파일: test.py 프로젝트: hypercoregz/porter
 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
예제 #2
0
파일: test.py 프로젝트: hypercoregz/porter
 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)
예제 #3
0
파일: test.py 프로젝트: shunfan/porter
 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)
예제 #4
0
파일: test.py 프로젝트: shunfan/porter
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)
예제 #5
0
파일: test.py 프로젝트: hypercoregz/porter
def init():
    mkdir(test_porter, force=True)
    mkdir(dir1)
    mkdir(dir2)
    create(dir1_f1)
    create(dir2_f2)