當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。