#16664: Add regression tests for glob's behaviour concerning "."-entries
Patch by Sebastian Kreft.
This commit is contained in:
parent
7eb8a1a0cb
commit
dec59ec5ff
@ -4,6 +4,7 @@ import glob
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
class GlobTests(unittest.TestCase):
|
class GlobTests(unittest.TestCase):
|
||||||
|
|
||||||
def norm(self, *parts):
|
def norm(self, *parts):
|
||||||
@ -18,9 +19,11 @@ class GlobTests(unittest.TestCase):
|
|||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.tempdir = TESTFN+"_dir"
|
self.tempdir = TESTFN + "_dir"
|
||||||
self.mktemp('a', 'D')
|
self.mktemp('a', 'D')
|
||||||
self.mktemp('aab', 'F')
|
self.mktemp('aab', 'F')
|
||||||
|
self.mktemp('.aa', 'G')
|
||||||
|
self.mktemp('.bb', 'H')
|
||||||
self.mktemp('aaa', 'zzzF')
|
self.mktemp('aaa', 'zzzF')
|
||||||
self.mktemp('ZZZ')
|
self.mktemp('ZZZ')
|
||||||
self.mktemp('a', 'bcd', 'EF')
|
self.mktemp('a', 'bcd', 'EF')
|
||||||
@ -66,6 +69,8 @@ class GlobTests(unittest.TestCase):
|
|||||||
eq = self.assertSequencesEqual_noorder
|
eq = self.assertSequencesEqual_noorder
|
||||||
eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa']))
|
eq(self.glob('a*'), map(self.norm, ['a', 'aab', 'aaa']))
|
||||||
eq(self.glob('*a'), map(self.norm, ['a', '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?'), map(self.norm, ['aaa', 'aab']))
|
||||||
eq(self.glob('aa[ab]'), map(self.norm, ['aaa', 'aab']))
|
eq(self.glob('aa[ab]'), map(self.norm, ['aaa', 'aab']))
|
||||||
eq(self.glob('*q'), [])
|
eq(self.glob('*q'), [])
|
||||||
|
@ -587,6 +587,7 @@ Jerzy Kozera
|
|||||||
Maksim Kozyarchuk
|
Maksim Kozyarchuk
|
||||||
Stefan Krah
|
Stefan Krah
|
||||||
Bob Kras
|
Bob Kras
|
||||||
|
Sebastian Kreft
|
||||||
Holger Krekel
|
Holger Krekel
|
||||||
Michael Kremer
|
Michael Kremer
|
||||||
Fabian Kreutz
|
Fabian Kreutz
|
||||||
|
@ -689,6 +689,9 @@ Extension Modules
|
|||||||
Tests
|
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
|
- 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
|
shutil.rmtree not ignore all errors. Also add a test ensuring that rmtree
|
||||||
fails when being called on a symlink. Patch by Serhiy Storchaka.
|
fails when being called on a symlink. Patch by Serhiy Storchaka.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user