[Python-checkins] r78101 - python/trunk/Lib/test/test_fnmatch.py

georg.brandl python-checkins at python.org
Mon Feb 8 01:04:54 CET 2010


Author: georg.brandl
Date: Mon Feb 8 01:04:54 2010
New Revision: 78101
Log:
Fix test_fnmatch.
Modified:
 python/trunk/Lib/test/test_fnmatch.py
Modified: python/trunk/Lib/test/test_fnmatch.py
==============================================================================
--- python/trunk/Lib/test/test_fnmatch.py	(original)
+++ python/trunk/Lib/test/test_fnmatch.py	Mon Feb 8 01:04:54 2010
@@ -7,13 +7,13 @@
 
 
 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 @@
 
 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():


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /