summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_glob.py
diff options
context:
space:
mode:
authorJohannes Gijsbers <jlg@dds.nl>2004-08-30 10:19:56 (GMT)
committerJohannes Gijsbers <jlg@dds.nl>2004-08-30 10:19:56 (GMT)
commitae882f798435266b41a9c8966562102345a3eda5 (patch)
tree56f865bf36c127b6702fa53a5ad72daca0fa6570 /Lib/test/test_glob.py
parentd3f61a2de6a9664dde5f98b5d0acdef7a73948dc (diff)
downloadcpython-ae882f798435266b41a9c8966562102345a3eda5.zip
cpython-ae882f798435266b41a9c8966562102345a3eda5.tar.gz
cpython-ae882f798435266b41a9c8966562102345a3eda5.tar.bz2
Patch #941486: add os.path.lexists(). Also fix bug #940578 by using lexists in glob.glob.
Diffstat (limited to 'Lib/test/test_glob.py')
-rw-r--r--Lib/test/test_glob.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
index 31de30d..af81dab 100644
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -48,6 +48,9 @@ class GlobTests(unittest.TestCase):
self.mktemp('ZZZ')
self.mktemp('a', 'bcd', 'EF')
self.mktemp('a', 'bcd', 'efg', 'ha')
+ if hasattr(os, 'symlink'):
+ os.symlink(self.norm('broken'), self.norm('sym1'))
+ os.symlink(self.norm('broken'), self.norm('sym2'))
def tearDown(self):
deltree(self.tempdir)
@@ -98,6 +101,13 @@ class GlobTests(unittest.TestCase):
eq(self.glob('?a?', '*F'), map(self.norm, [os.path.join('aaa', 'zzzF'),
os.path.join('aab', 'F')]))
+ def test_glob_broken_symlinks(self):
+ if hasattr(os, 'symlink'):
+ eq = self.assertSequencesEqual_noorder
+ eq(self.glob('sym*'), [self.norm('sym1'), self.norm('sym2')])
+ eq(self.glob('sym1'), [self.norm('sym1')])
+ eq(self.glob('sym2'), [self.norm('sym2')])
+
def test_main():
run_unittest(GlobTests)