diff options
author | Brian Curtin <brian.curtin@gmail.com> | 2010-12-28 14:31:47 (GMT) |
---|---|---|
committer | Brian Curtin <brian.curtin@gmail.com> | 2010-12-28 14:31:47 (GMT) |
commit | 3b4499c5c7718a2aca8558b857dfe02cc4a80cd9 (patch) | |
tree | e952e750f0913c99ca1d4b021736476baab55408 /Lib/test/test_glob.py | |
parent | baab9d0bf6d1627aa292a7639878ae9ba46fc2ca (diff) | |
download | cpython-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_glob.py')
-rw-r--r-- | Lib/test/test_glob.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py index f1e1c03..1560a6b 100644 --- a/Lib/test/test_glob.py +++ b/Lib/test/test_glob.py @@ -1,5 +1,5 @@ import unittest -from test.support import run_unittest, TESTFN +from test.support import run_unittest, TESTFN, skip_unless_symlink, can_symlink import glob import os import shutil @@ -25,7 +25,7 @@ class GlobTests(unittest.TestCase): self.mktemp('ZZZ') self.mktemp('a', 'bcd', 'EF') self.mktemp('a', 'bcd', 'efg', 'ha') - if hasattr(os, "symlink"): + if can_symlink(): os.symlink(self.norm('broken'), self.norm('sym1')) os.symlink(self.norm('broken'), self.norm('sym2')) @@ -98,8 +98,7 @@ class GlobTests(unittest.TestCase): # either of these results are reasonable self.assertIn(res[0], [self.tempdir, self.tempdir + os.sep]) - @unittest.skipUnless(hasattr(os, "symlink"), - "Missing symlink implementation") + @skip_unless_symlink def test_glob_broken_symlinks(self): eq = self.assertSequencesEqual_noorder eq(self.glob('sym*'), [self.norm('sym1'), self.norm('sym2')]) |