当前位置: 首页>>代码示例>>Python>>正文


Python Spec.should_collaborate_with方法代码示例

本文整理汇总了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')
开发者ID:gbremer,项目名称:lancelot,代码行数:11,代码来源:constraint_spec.py

示例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)
开发者ID:gbremer,项目名称:lancelot,代码行数:25,代码来源:verification_spec.py


注:本文中的lancelot.Spec.should_collaborate_with方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。