예제 #1
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_copy_without_ignore_error(self, tmpdir):
     d1 = str(tmpdir.join('test1'))
     d2 = str(tmpdir.join('test2'))
     makedirs(d1)
     makedirs(d2)
     with pytest.raises(Exception):
         copy(d1, d2, ignore_errors=False)
예제 #2
0
 def test_copy_path_to_exits_path(self, tmpdir):
     d1 = str(tmpdir.join('test1'))
     d2 = str(tmpdir.join('test2'))
     makedirs(d1)
     makedirs(d2)
     with pytest.raises(Exception):
         copy(d1, d2)
예제 #3
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_copy_path_to_exits_path(self, tmpdir):
     d1 = str(tmpdir.join('test1'))
     d2 = str(tmpdir.join('test2'))
     makedirs(d1)
     makedirs(d2)
     with pytest.raises(Exception):
         copy(d1, d2)
예제 #4
0
 def test_copy_without_ignore_error(self, tmpdir):
     d1 = str(tmpdir.join('test1'))
     d2 = str(tmpdir.join('test2'))
     makedirs(d1)
     makedirs(d2)
     with pytest.raises(Exception):
         copy(d1, d2, ignore_errors=False)
예제 #5
0
 def test_removes_paths(self, tmpdir):
     path1 = str(tmpdir.join('test1'))
     path2 = str(tmpdir.join('test2'))
     path3 = str(tmpdir.join('test3'))
     for path in [path1, path2, path3]:
         makedirs(path)
     removes([path1, path2, path3])
     assert not os.path.exists(path1)
     assert not os.path.exists(path2)
     assert not os.path.exists(path3)
예제 #6
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_removes_paths(self, tmpdir):
     path1 = str(tmpdir.join('test1'))
     path2 = str(tmpdir.join('test2'))
     path3 = str(tmpdir.join('test3'))
     for path in [path1, path2, path3]:
         makedirs(path)
     removes([path1, path2, path3])
     assert not os.path.exists(path1)
     assert not os.path.exists(path2)
     assert not os.path.exists(path3)
예제 #7
0
 def test_removes_files_and_path(self, tmpdir):
     f1 = str(tmpdir.join('test1.txt'))
     f2 = str(tmpdir.join('test2.txt'))
     p1 = str(tmpdir.join('test1'))
     p2 = str(tmpdir.join('test2'))
     for f in [f1, f2]:
         touch(f)
     for p in [p1, p2]:
         makedirs(p)
     removes([f1, f2, p1, p2])
     for f in [f1, f2, p1, p2]:
         assert not os.path.exists(f)
예제 #8
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_copy_dir_not_follow_symlink(self, tmpdir):
     f = str(tmpdir.join('test/test.txt'))
     d = str(tmpdir.join('test'))
     link_f = str(tmpdir.join('test/test_link.txt'))
     d_copy = str(tmpdir.join('test_copy'))
     new_link_f = str(tmpdir.join('test_copy/test_link.txt'))
     makedirs(d)
     touch(f)
     os.symlink(f, link_f)
     copy(d, d_copy, follow_symlinks=False)
     assert os.path.exists(d_copy)
     assert not os.path.islink(new_link_f)
예제 #9
0
 def test_copy_dir_not_follow_symlink(self, tmpdir):
     f = str(tmpdir.join('test/test.txt'))
     d = str(tmpdir.join('test'))
     link_f = str(tmpdir.join('test/test_link.txt'))
     d_copy = str(tmpdir.join('test_copy'))
     new_link_f = str(tmpdir.join('test_copy/test_link.txt'))
     makedirs(d)
     touch(f)
     os.symlink(f, link_f)
     copy(d, d_copy, follow_symlinks=False)
     assert os.path.exists(d_copy)
     assert not os.path.islink(new_link_f)
예제 #10
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_removes_files_and_path(self, tmpdir):
     f1 = str(tmpdir.join('test1.txt'))
     f2 = str(tmpdir.join('test2.txt'))
     p1 = str(tmpdir.join('test1'))
     p2 = str(tmpdir.join('test2'))
     for f in [f1, f2]:
         touch(f)
     for p in [p1, p2]:
         makedirs(p)
     removes([f1, f2, p1, p2])
     for f in [f1, f2, p1, p2]:
         assert not os.path.exists(f)
예제 #11
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_link_with_ignore_error(self, tmpdir):
     dirname = str(tmpdir.join('test'))
     link_dirname = str(tmpdir.join('test.link'))
     makedirs(dirname)
     link(dirname, link_dirname, ignore_errors=True)
예제 #12
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_symlink_with_ignore_error(self, tmpdir):
     d = str(tmpdir.join('test'))
     link_d = str(tmpdir.join('test.link'))
     makedirs(d)
     link(d, link_d, ignore_errors=True)
예제 #13
0
 def test_copy_empty_dir(self, tmpdir):
     d = str(tmpdir.join('test'))
     d_copy = str(tmpdir.join('test_copy'))
     makedirs(d)
     copy(d, d_copy)
     assert os.path.exists(d_copy)
예제 #14
0
 def test_symlink_without_ignore_error(self, tmpdir):
     d = str(tmpdir.join('test'))
     link_d = str(tmpdir.join('test.link'))
     makedirs(d)
     with pytest.raises(Exception):
         link(d, link_d)
예제 #15
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_copy_empty_dir(self, tmpdir):
     d = str(tmpdir.join('test'))
     d_copy = str(tmpdir.join('test_copy'))
     makedirs(d)
     copy(d, d_copy)
     assert os.path.exists(d_copy)
예제 #16
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_copy_with_ignore_error(self, tmpdir):
     d1 = str(tmpdir.join('test1'))
     d2 = str(tmpdir.join('test2'))
     makedirs(d1)
     makedirs(d2)
     copy(d1, d2, ignore_errors=True)
예제 #17
0
 def test_makedirs_with_ignore_error(self, tmpdir):
     path = str(tmpdir.join('test'))
     makedirs(path)
     makedirs(path, ignore_errors=True)
예제 #18
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_makedirs_with_mutl_dirs(self, tmpdir):
     path = str(tmpdir.join('test/test'))
     makedirs(path)
     assert os.path.exists(path)
예제 #19
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_remove_mutil_dirs(self, tmpdir):
     path = str(tmpdir.join('test/test'))
     makedirs(path)
     path = str(tmpdir.join('test'))
     remove(path)
     assert not os.path.exists(path)
예제 #20
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_makedirs_without_ignore_error(self, tmpdir):
     path = str(tmpdir.join('test'))
     makedirs(path)
     with pytest.raises(Exception):
         makedirs(path, ignore_errors=False, exist_ok=False)
예제 #21
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_makedirs_with_ignore_error(self, tmpdir):
     path = str(tmpdir.join('test'))
     makedirs(path)
     makedirs(path, ignore_errors=True)
예제 #22
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_makedirs_with_exists_path(self, tmpdir):
     path = str(tmpdir.join('test'))
     makedirs(path)
     makedirs(path, exist_ok=True)
     with pytest.raises(Exception):
         makedirs(path, exist_ok=False)
예제 #23
0
 def test_copy_with_ignore_error(self, tmpdir):
     d1 = str(tmpdir.join('test1'))
     d2 = str(tmpdir.join('test2'))
     makedirs(d1)
     makedirs(d2)
     copy(d1, d2, ignore_errors=True)
예제 #24
0
 def test_makedirs_with_mutl_dirs(self, tmpdir):
     path = str(tmpdir.join('test/test'))
     makedirs(path)
     assert os.path.exists(path)
예제 #25
0
 def test_makedirs_with_exists_path(self, tmpdir):
     path = str(tmpdir.join('test'))
     makedirs(path)
     makedirs(path, exist_ok=True)
     with pytest.raises(Exception):
         makedirs(path, exist_ok=False)
예제 #26
0
파일: test_system.py 프로젝트: amigooy/pydu
 def test_symlink_without_ignore_error(self, tmpdir):
     d = str(tmpdir.join('test'))
     link_d = str(tmpdir.join('test.link'))
     makedirs(d)
     with pytest.raises(Exception):
         link(d, link_d)
예제 #27
0
 def test_makedirs_without_ignore_error(self, tmpdir):
     path = str(tmpdir.join('test'))
     makedirs(path)
     with pytest.raises(Exception):
         makedirs(path, ignore_errors=False, exist_ok=False)
예제 #28
0
 def test_link_with_ignore_error(self, tmpdir):
     dirname = str(tmpdir.join('test'))
     link_dirname = str(tmpdir.join('test.link'))
     makedirs(dirname)
     link(dirname, link_dirname, ignore_errors=True)
예제 #29
0
 def test_remove_mutil_dirs(self, tmpdir):
     path = str(tmpdir.join('test/test'))
     makedirs(path)
     path = str(tmpdir.join('test'))
     remove(path)
     assert not os.path.exists(path)
예제 #30
0
 def test_symlink_with_ignore_error(self, tmpdir):
     d = str(tmpdir.join('test'))
     link_d = str(tmpdir.join('test.link'))
     makedirs(d)
     link(d, link_d, ignore_errors=True)