本文整理汇总了Python中lancelot.Spec.should_collaborate_with方法的典型用法代码示例。如果您正苦于以下问题:Python Spec.should_collaborate_with方法的具体用法?Python Spec.should_collaborate_with怎么用?Python Spec.should_collaborate_with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lancelot.Spec
的用法示例。
在下文中一共展示了Spec.should_collaborate_with方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: desc_should_use_comparator
# 需要导入模块: from lancelot import Spec [as 别名]
# 或者: from lancelot.Spec import should_collaborate_with [as 别名]
def desc_should_use_comparator(self):
''' describe_constraint should delegate to comparator.description '''
comparator = MockSpec()
spec = Spec(Constraint(comparator))
comparator_description = comparator.description()
comparator_description.will_return('subtitled')
spec.describe_constraint()
spec.should_collaborate_with(comparator_description,
and_result='should be subtitled')
示例2: notification_behaviour
# 需要导入模块: from lancelot import Spec [as 别名]
# 或者: from lancelot.Spec import should_collaborate_with [as 别名]
def notification_behaviour():
''' listener should receive notifications AllVerifiable.verify() '''
listener = MockSpec()
all_verifiable_with_mock_listener = AllVerifiable(listener)
results = {'total': 3, 'verified': 1, 'unverified': 2}
spec = Spec(all_verifiable_with_mock_listener)
spec.when(spec.include(string_abc),
spec.include(raise_index_error),
spec.include(unmet_specification))
spec.then(spec.verify())
spec.should_collaborate_with(
listener.all_verifiable_starting(all_verifiable_with_mock_listener),
listener.verification_started(string_abc),
listener.specification_met(string_abc),
listener.verification_started(raise_index_error),
listener.unexpected_exception(raise_index_error, Type(IndexError)),
listener.verification_started(unmet_specification),
listener.specification_unmet(unmet_specification,
Type(UnmetSpecification)),
listener.all_verifiable_ending(all_verifiable_with_mock_listener,
results),
and_result = results)