Esempio n. 1
0
 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
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
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)
Esempio n. 5
0
def init():
    mkdir(test_porter, force=True)
    mkdir(dir1)
    mkdir(dir2)
    create(dir1_f1)
    create(dir2_f2)