本文整理汇总了Python中tests.utils.Rule.get_corrected_commands方法的典型用法代码示例。如果您正苦于以下问题:Python Rule.get_corrected_commands方法的具体用法?Python Rule.get_corrected_commands怎么用?Python Rule.get_corrected_commands使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.utils.Rule
的用法示例。
在下文中一共展示了Rule.get_corrected_commands方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_corrected_commands_with_rule_returns_list
# 需要导入模块: from tests.utils import Rule [as 别名]
# 或者: from tests.utils.Rule import get_corrected_commands [as 别名]
def test_get_corrected_commands_with_rule_returns_list(self):
rule = Rule(get_new_command=lambda x: [x.script + '!', x.script + '@'],
priority=100)
assert list(rule.get_corrected_commands(Command(script='test'))) \
== [CorrectedCommand(script='test!', priority=100),
CorrectedCommand(script='[email protected]', priority=200)]
示例2: test_get_corrected_commands_with_rule_returns_command
# 需要导入模块: from tests.utils import Rule [as 别名]
# 或者: from tests.utils.Rule import get_corrected_commands [as 别名]
def test_get_corrected_commands_with_rule_returns_command(self):
rule = Rule(get_new_command=lambda x: x.script + '!',
priority=100)
assert (list(rule.get_corrected_commands(Command(script='test')))
== [CorrectedCommand(script='test!', priority=100)])
示例3: test_get_corrected_commands_with_rule_returns_list
# 需要导入模块: from tests.utils import Rule [as 别名]
# 或者: from tests.utils.Rule import get_corrected_commands [as 别名]
def test_get_corrected_commands_with_rule_returns_list(self):
rule = Rule(get_new_command=lambda x: [x.script + "!", x.script + "@"], priority=100)
assert list(rule.get_corrected_commands(Command(script="test"))) == [
CorrectedCommand(script="test!", priority=100),
CorrectedCommand(script="[email protected]", priority=200),
]