diff options
author | Guido van Rossum <guido@python.org> | 2008-10-02 18:55:37 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2008-10-02 18:55:37 (GMT) |
commit | f0af3e30db9475ab68bcb1f1ce0b5581e214df76 (patch) | |
tree | 71efbc67686d96e8c8a81dd97c75c419adf36657 /Lib/test/test_fnmatch.py | |
parent | fefeca53eebe8665c08ac0c041639ada3c9f9446 (diff) | |
download | cpython-f0af3e30db9475ab68bcb1f1ce0b5581e214df76.zip cpython-f0af3e30db9475ab68bcb1f1ce0b5581e214df76.tar.gz cpython-f0af3e30db9475ab68bcb1f1ce0b5581e214df76.tar.bz2 |
Issue #3187: Better support for "undecodable" filenames. Code by Victor
Stinner, with small tweaks by GvR.
Diffstat (limited to 'Lib/test/test_fnmatch.py')
-rw-r--r-- | Lib/test/test_fnmatch.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_fnmatch.py b/Lib/test/test_fnmatch.py index c593704..30ccf69 100644 --- a/Lib/test/test_fnmatch.py +++ b/Lib/test/test_fnmatch.py @@ -37,6 +37,15 @@ class FnmatchTestCase(unittest.TestCase): check('a', r'[!\]') check('\\', r'[!\]', 0) + def test_mix_bytes_str(self): + self.assertRaises(TypeError, fnmatch, 'test', b'*') + self.assertRaises(TypeError, fnmatch, b'test', '*') + self.assertRaises(TypeError, fnmatchcase, 'test', b'*') + self.assertRaises(TypeError, fnmatchcase, b'test', '*') + + def test_bytes(self): + self.check_match(b'test', b'te*') + self.check_match(b'test\xff', b'te*\xff') def test_main(): support.run_unittest(FnmatchTestCase) |