[Python-checkins] python/dist/src/Lib/test test_glob.py, 1.7, 1.8 test_posixpath.py, 1.11, 1.12

jlgijsbers at users.sourceforge.net jlgijsbers at users.sourceforge.net
Mon Aug 30 12:20:29 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30857/Lib/test

Modified Files:
	test_glob.py test_posixpath.py 
Log Message:
Patch #941486: add os.path.lexists(). Also fix bug #940578 by using lexists in glob.glob.




Index: test_glob.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_glob.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- test_glob.py	16 Nov 2003 16:17:48 -0000	1.7
+++ test_glob.py	30 Aug 2004 10:19:56 -0000	1.8
@@ -48,6 +48,9 @@
         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 @@
         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)

Index: test_posixpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_posixpath.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- test_posixpath.py	20 Aug 2004 03:47:14 -0000	1.11
+++ test_posixpath.py	30 Aug 2004 10:19:56 -0000	1.12
@@ -150,6 +150,7 @@
                 os.remove(test_support.TESTFN + "1")
                 self.assertIs(posixpath.islink(test_support.TESTFN + "2"), True)
                 self.assertIs(posixpath.exists(test_support.TESTFN + "2"), False)
+                self.assertIs(posixpath.lexists(test_support.TESTFN + "2"), True)
         finally:
             if not f.close():
                 f.close()
@@ -171,6 +172,7 @@
             f.write("foo")
             f.close()
             self.assertIs(posixpath.exists(test_support.TESTFN), True)
+            self.assertIs(posixpath.lexists(test_support.TESTFN), True)
         finally:
             if not f.close():
                 f.close()



More information about the Python-checkins mailing list