summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorBrian Curtin <brian.curtin@gmail.com>2010-12-28 14:31:47 (GMT)
committerBrian Curtin <brian.curtin@gmail.com>2010-12-28 14:31:47 (GMT)
commit3b4499c5c7718a2aca8558b857dfe02cc4a80cd9 (patch)
treee952e750f0913c99ca1d4b021736476baab55408 /Lib/test/test_shutil.py
parentbaab9d0bf6d1627aa292a7639878ae9ba46fc2ca (diff)
downloadcpython-3b4499c5c7718a2aca8558b857dfe02cc4a80cd9.zip
cpython-3b4499c5c7718a2aca8558b857dfe02cc4a80cd9.tar.gz
cpython-3b4499c5c7718a2aca8558b857dfe02cc4a80cd9.tar.bz2
Fix #9333. The symlink function is always available now, raising OSError
when the user doesn't hold the symbolic link privilege rather than hiding it.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index d9e9678..30d9e07 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -291,8 +291,7 @@ class TestShutil(unittest.TestCase):
finally:
shutil.rmtree(TESTFN, ignore_errors=True)
- @unittest.skipUnless(hasattr(os, "symlink"),
- "Missing symlink implementation")
+ @support.skip_unless_symlink
def test_dont_copy_file_onto_symlink_to_itself(self):
# bug 851123.
os.mkdir(TESTFN)
@@ -312,8 +311,7 @@ class TestShutil(unittest.TestCase):
finally:
shutil.rmtree(TESTFN, ignore_errors=True)
- @unittest.skipUnless(hasattr(os, "symlink"),
- "Missing symlink implementation")
+ @support.skip_unless_symlink
def test_rmtree_on_symlink(self):
# bug 1669.
os.mkdir(TESTFN)
@@ -338,8 +336,7 @@ class TestShutil(unittest.TestCase):
finally:
os.remove(TESTFN)
- @unittest.skipUnless(hasattr(os, "symlink"),
- "Missing symlink implementation")
+ @support.skip_unless_symlink
def test_copytree_named_pipe(self):
os.mkdir(TESTFN)
try:
@@ -375,8 +372,7 @@ class TestShutil(unittest.TestCase):
shutil.copytree(src_dir, dst_dir, copy_function=_copy)
self.assertEqual(len(copied), 2)
- @unittest.skipUnless(hasattr(os, "symlink"),
- "Missing symlink implementation")
+ @support.skip_unless_symlink
def test_copytree_dangling_symlinks(self):
# a dangling symlink raises an error at the end