コード例 #1
0
ファイル: test_system.py プロジェクト: yzgodlike/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)
コード例 #2
0
ファイル: test_system.py プロジェクト: yzgodlike/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)
コード例 #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
ファイル: 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)
コード例 #5
0
ファイル: test_system.py プロジェクト: yzgodlike/pydu
 def test_copy_non_empty_dir(self, tmpdir):
     f = str(tmpdir.join('test/test.txt'))
     d = str(tmpdir.join('test'))
     d_copy = str(tmpdir.join('test_copy'))
     os.makedirs(d)
     touch(f)
     copy(d, d_copy)
     assert os.path.exists(d_copy)
コード例 #6
0
ファイル: test_system.py プロジェクト: amigooy/pydu
 def test_copy_non_empty_dir(self, tmpdir):
     f = str(tmpdir.join('test/test.txt'))
     d = str(tmpdir.join('test'))
     d_copy = str(tmpdir.join('test_copy'))
     os.makedirs(d)
     touch(f)
     copy(d, d_copy)
     assert os.path.exists(d_copy)
コード例 #7
0
ファイル: test_system.py プロジェクト: yzgodlike/pydu
 def test_copy_file_not_follow_symlink(self, tmpdir):
     f = str(tmpdir.join('test.txt'))
     link_f = str(tmpdir.join('test.link'))
     copy_link_f = str(tmpdir.join('test_copy.link'))
     touch(f)
     os.symlink(f, link_f)
     copy(link_f, copy_link_f, follow_symlinks=False)
     assert os.path.exists(copy_link_f)
     assert os.path.islink(copy_link_f)
コード例 #8
0
ファイル: test_system.py プロジェクト: amigooy/pydu
 def test_copy_file_not_follow_symlink(self, tmpdir):
     f = str(tmpdir.join('test.txt'))
     link_f = str(tmpdir.join('test.link'))
     copy_link_f = str(tmpdir.join('test_copy.link'))
     touch(f)
     os.symlink(f, link_f)
     copy(link_f, copy_link_f, follow_symlinks=False)
     assert os.path.exists(copy_link_f)
     assert os.path.islink(copy_link_f)
コード例 #9
0
ファイル: test_system.py プロジェクト: yzgodlike/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)
コード例 #10
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)
コード例 #11
0
ファイル: test_system.py プロジェクト: yzgodlike/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)
コード例 #12
0
ファイル: test_system.py プロジェクト: yzgodlike/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)
コード例 #13
0
ファイル: test_system.py プロジェクト: yzgodlike/pydu
 def test_copy_file(self, tmpdir):
     f = str(tmpdir.join('test.txt'))
     f_copy = str(tmpdir.join('test_copy.txt'))
     touch(f)
     copy(f, f_copy)
     assert os.path.exists(f_copy)
コード例 #14
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)
コード例 #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_file(self, tmpdir):
     f = str(tmpdir.join('test.txt'))
     f_copy = str(tmpdir.join('test_copy.txt'))
     touch(f)
     copy(f, f_copy)
     assert os.path.exists(f_copy)