本文整理汇总了Python中Gaffer.matchMultiple方法的典型用法代码示例。如果您正苦于以下问题:Python Gaffer.matchMultiple方法的具体用法?Python Gaffer.matchMultiple怎么用?Python Gaffer.matchMultiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gaffer
的用法示例。
在下文中一共展示了Gaffer.matchMultiple方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testMultiple
# 需要导入模块: import Gaffer [as 别名]
# 或者: from Gaffer import matchMultiple [as 别名]
def testMultiple(self):
for s, p, r in [
("", "", True),
("a", "b a", True),
("a", "c *", True),
("ab", "c a*", True),
("cat", "dog fish", False),
("cat", "cad cat", True),
("cat", "cad ", False),
("cat", "cat ", True),
("cat", "cadcat", False),
("dogfish", "cat *fish", True),
("dogcollar", "dog *fish", False),
("dogcollar", "dog collar", False),
("a1", "*1 b2", True),
]:
self.assertEqual(Gaffer.matchMultiple(s, p), r)
示例2: test
# 需要导入模块: import Gaffer [as 别名]
# 或者: from Gaffer import matchMultiple [as 别名]
def test(self):
for s, p, r in [
("", "", True),
("a", "a", True),
("a", "*", True),
("ab", "a*", True),
("cat", "dog", False),
("dogfish", "*fish", True),
("dogcollar", "*fish", False),
("dog collar", "dog collar", True),
("dog collar", "dog co*", True),
("dog collar", "dog *", True),
("dog collar", "dog*", True),
]:
self.assertEqual(Gaffer.match(s, p), r)
if " " not in s:
self.assertEqual(Gaffer.matchMultiple(s, p), r)