[Python-checkins] cpython (3.2): #16664: Add regression tests for glob's behaviour concerning "."-entries

hynek.schlawack python-checkins at python.org
Sun Dec 16 12:49:05 CET 2012


http://hg.python.org/cpython/rev/29f0c45ce576
changeset:   80875:29f0c45ce576
branch:      3.2
parent:      80865:8ba5a34e103e
user:        Hynek Schlawack <hs at ox.cx>
date:        Sun Dec 16 12:39:11 2012 +0100
summary:
  #16664: Add regression tests for glob's behaviour concerning "."-entries

Patch by Sebastian Kreft.

files:
  Lib/test/test_glob.py |  7 ++++++-
  Misc/ACKS             |  1 +
  Misc/NEWS             |  3 +++
  3 files changed, 10 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -4,6 +4,7 @@
 import os
 import shutil
 
+
 class GlobTests(unittest.TestCase):
 
     def norm(self, *parts):
@@ -18,9 +19,11 @@
         f.close()
 
     def setUp(self):
-        self.tempdir = TESTFN+"_dir"
+        self.tempdir = TESTFN + "_dir"
         self.mktemp('a', 'D')
         self.mktemp('aab', 'F')
+        self.mktemp('.aa', 'G')
+        self.mktemp('.bb', 'H')
         self.mktemp('aaa', 'zzzF')
         self.mktemp('ZZZ')
         self.mktemp('a', 'bcd', 'EF')
@@ -66,6 +69,8 @@
         eq = self.assertSequencesEqual_noorder
         eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa']))
         eq(self.glob('*a'), map(self.norm, ['a', 'aaa']))
+        eq(self.glob('.*'), map(self.norm, ['.aa', '.bb']))
+        eq(self.glob('?aa'), map(self.norm, ['aaa']))
         eq(self.glob('aa?'), map(self.norm, ['aaa', 'aab']))
         eq(self.glob('aa[ab]'), map(self.norm, ['aaa', 'aab']))
         eq(self.glob('*q'), [])
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -587,6 +587,7 @@
 Maksim Kozyarchuk
 Stefan Krah
 Bob Kras
+Sebastian Kreft
 Holger Krekel
 Michael Kremer
 Fabian Kreutz
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -689,6 +689,9 @@
 Tests
 -----
 
+- Issue #16664: Add regression tests for glob's behaviour concerning entries
+  starting with a ".".  Patch by Sebastian Kreft.
+
 - Issue #15872: Add tests for a 3.3 regression which caused the new fd-based
   shutil.rmtree not ignore all errors. Also add a test ensuring that rmtree
   fails when being called on a symlink. Patch by Serhiy Storchaka.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list