Kaydet (Commit) 6eedef60 authored tarafından Georg Brandl's avatar Georg Brandl

Fix test_fnmatch.

üst 841e7f3a
......@@ -7,13 +7,13 @@ from fnmatch import fnmatch, fnmatchcase
class FnmatchTestCase(unittest.TestCase):
def check_match(self, filename, pattern, should_match=1):
def check_match(self, filename, pattern, should_match=1, fn=fnmatch):
if should_match:
self.assertTrue(fnmatch(filename, pattern),
self.assertTrue(fn(filename, pattern),
"expected %r to match pattern %r"
% (filename, pattern))
else:
self.assertTrue(not fnmatch(filename, pattern),
self.assertTrue(not fn(filename, pattern),
"expected %r not to match pattern %r"
% (filename, pattern))
......@@ -46,8 +46,8 @@ class FnmatchTestCase(unittest.TestCase):
def test_fnmatchcase(self):
check = self.check_match
check('AbC', 'abc', 0)
check('abc', 'AbC', 0)
check('AbC', 'abc', 0, fnmatchcase)
check('abc', 'AbC', 0, fnmatchcase)
def test_main():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment