本文整理匯總了Python中robot.utils.Matcher.match_any方法的典型用法代碼示例。如果您正苦於以下問題:Python Matcher.match_any方法的具體用法?Python Matcher.match_any怎麽用?Python Matcher.match_any使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類robot.utils.Matcher
的用法示例。
在下文中一共展示了Matcher.match_any方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _SingleTagPattern
# 需要導入模塊: from robot.utils import Matcher [as 別名]
# 或者: from robot.utils.Matcher import match_any [as 別名]
class _SingleTagPattern(object):
def __init__(self, pattern):
self._matcher = Matcher(pattern, ignore='_')
def match(self, tags):
return self._matcher.match_any(tags)
def __unicode__(self):
return self._matcher.pattern
示例2: _SingleTagPattern
# 需要導入模塊: from robot.utils import Matcher [as 別名]
# 或者: from robot.utils.Matcher import match_any [as 別名]
class _SingleTagPattern(object):
def __init__(self, pattern):
self._matcher = Matcher(pattern, ignore='_')
def match(self, tags):
return self._matcher.match_any(tags)
# FIXME: Why only this class methods below??
def __unicode__(self):
return self._matcher.pattern
def __nonzero__(self):
return bool(self._matcher)
示例3: SingleTagPattern
# 需要導入模塊: from robot.utils import Matcher [as 別名]
# 或者: from robot.utils.Matcher import match_any [as 別名]
class SingleTagPattern(object):
def __init__(self, pattern):
self._matcher = Matcher(pattern, ignore='_')
def match(self, tags):
return self._matcher.match_any(tags)
def __iter__(self):
yield self
def __unicode__(self):
return self._matcher.pattern
def __nonzero__(self):
return bool(self._matcher)
示例4: test_regexp_match_any
# 需要導入模塊: from robot.utils import Matcher [as 別名]
# 或者: from robot.utils.Matcher import match_any [as 別名]
def test_regexp_match_any(self):
matcher = Matcher('H.llo', regexp=True)
assert matcher.match_any(('Hello', 'world'))
assert matcher.match_any(['jam', 'is', 'hillo'])
assert not matcher.match_any(('no', 'match', 'here'))
assert not matcher.match_any(())
示例5: test_match_any
# 需要導入模塊: from robot.utils import Matcher [as 別名]
# 或者: from robot.utils.Matcher import match_any [as 別名]
def test_match_any(self):
matcher = Matcher('H?llo')
assert matcher.match_any(('Hello', 'world'))
assert matcher.match_any(['jam', 'is', 'hillo'])
assert not matcher.match_any(('no', 'match', 'here'))
assert not matcher.match_any(())