Lines Matching refs:fnmatch
689 def fnmatch(inclusive, filename, pattern): function
693 self.assertTrue(fnmatch(True, "abc", "abc"))
694 self.assertFalse(fnmatch(True, "12356", "abc"))
695 self.assertFalse(fnmatch(True, "<unknown>", "abc"))
697 self.assertFalse(fnmatch(False, "abc", "abc"))
698 self.assertTrue(fnmatch(False, "12356", "abc"))
699 self.assertTrue(fnmatch(False, "<unknown>", "abc"))
702 def fnmatch(filename, pattern): function
707 self.assertFalse(fnmatch('abc', ''))
708 self.assertFalse(fnmatch('', 'abc'))
709 self.assertTrue(fnmatch('', ''))
710 self.assertTrue(fnmatch('', '*'))
713 self.assertTrue(fnmatch('abc', 'abc'))
714 self.assertFalse(fnmatch('abc', 'abcd'))
715 self.assertFalse(fnmatch('abc', 'def'))
718 self.assertTrue(fnmatch('abc', 'a*'))
719 self.assertTrue(fnmatch('abc', 'abc*'))
720 self.assertFalse(fnmatch('abc', 'b*'))
721 self.assertFalse(fnmatch('abc', 'abcd*'))
724 self.assertTrue(fnmatch('abc', 'a*c'))
725 self.assertTrue(fnmatch('abcdcx', 'a*cx'))
726 self.assertFalse(fnmatch('abb', 'a*c'))
727 self.assertFalse(fnmatch('abcdce', 'a*cx'))
730 self.assertTrue(fnmatch('abcde', 'a*c*e'))
731 self.assertTrue(fnmatch('abcbdefeg', 'a*bd*eg'))
732 self.assertFalse(fnmatch('abcdd', 'a*c*e'))
733 self.assertFalse(fnmatch('abcbdefef', 'a*bd*eg'))
736 self.assertTrue(fnmatch('a.pyc', 'a.py'))
737 self.assertTrue(fnmatch('a.py', 'a.pyc'))
741 self.assertTrue(fnmatch('aBC', 'ABc'))
742 self.assertTrue(fnmatch('aBcDe', 'Ab*dE'))
744 self.assertTrue(fnmatch('a.pyc', 'a.PY'))
745 self.assertTrue(fnmatch('a.py', 'a.PYC'))
748 self.assertFalse(fnmatch('aBC', 'ABc'))
749 self.assertFalse(fnmatch('aBcDe', 'Ab*dE'))
751 self.assertFalse(fnmatch('a.pyc', 'a.PY'))
752 self.assertFalse(fnmatch('a.py', 'a.PYC'))
756 self.assertTrue(fnmatch(r'a/b', r'a\b'))
757 self.assertTrue(fnmatch(r'a\b', r'a/b'))
758 self.assertTrue(fnmatch(r'a/b\c', r'a\b/c'))
759 self.assertTrue(fnmatch(r'a/b/c', r'a\b\c'))
762 self.assertFalse(fnmatch(r'a/b', r'a\b'))
763 self.assertFalse(fnmatch(r'a\b', r'a/b'))
764 self.assertFalse(fnmatch(r'a/b\c', r'a\b/c'))
765 self.assertFalse(fnmatch(r'a/b/c', r'a\b\c'))
768 self.assertFalse(fnmatch('a.pyo', 'a.py'))