本文整理匯總了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)