summaryrefslogtreecommitdiff
path: root/Lib/test/test_glob.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-04-09 03:35:43 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-04-09 03:35:43 +0000
commita31bf18c48654640b7020e8900928f9db862a1a5 (patch)
treed2ccc08a0b2ef3fbad6b983a9dc434d37cb14844 /Lib/test/test_glob.py
parente0bb597d03bc97e1b201e27adb983aabf96e137b (diff)
downloadcpython-git-a31bf18c48654640b7020e8900928f9db862a1a5.tar.gz
glob('anything*/') would fail because isdir is in os.path, not os.
Diffstat (limited to 'Lib/test/test_glob.py')
-rw-r--r--Lib/test/test_glob.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
index 8a6ef7fada..5ce09f9d10 100644
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -80,6 +80,14 @@ 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_directory_with_trailing_slash(self):
+ # We are verifying that when there is wildcard pattern which
+ # ends with os.sep doesn't blow up.
+ res = glob.glob(self.tempdir + '*' + os.sep)
+ self.assertEqual(len(res), 1)
+ # either of these results are reasonable
+ self.assertTrue(res[0] in [self.tempdir, self.tempdir + os.sep])
+
def test_glob_broken_symlinks(self):
if hasattr(os, 'symlink'):
eq = self.assertSequencesEqual_noorder