當前位置: 首頁>>代碼示例>>Python>>正文


Python Step.error_message方法代碼示例

本文整理匯總了Python中behave.model.Step.error_message方法的典型用法代碼示例。如果您正苦於以下問題:Python Step.error_message方法的具體用法?Python Step.error_message怎麽用?Python Step.error_message使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在behave.model.Step的用法示例。


在下文中一共展示了Step.error_message方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_run_sets_status_to_passed_if_nothing_goes_wrong

# 需要導入模塊: from behave.model import Step [as 別名]
# 或者: from behave.model.Step import error_message [as 別名]
    def test_run_sets_status_to_passed_if_nothing_goes_wrong(self):
        step = Step('foo.feature', 17, u'Given', 'given', u'foo')
        step.error_message = None
        self.runner.step_registry.find_match.return_value = Mock()
        step.run(self.runner)

        eq_(step.status, Status.passed)
        eq_(step.error_message, None)
開發者ID:Abdoctor,項目名稱:behave,代碼行數:10,代碼來源:test_model.py

示例2: test_run_sets_status_to_passed_if_nothing_goes_wrong

# 需要導入模塊: from behave.model import Step [as 別名]
# 或者: from behave.model.Step import error_message [as 別名]
    def test_run_sets_status_to_passed_if_nothing_goes_wrong(self):
        step = Step("foo.feature", 17, u"Given", "given", u"foo")
        step.error_message = None
        self.runner.step_registry.find_match.return_value = Mock()
        step.run(self.runner)

        assert step.status == Status.passed
        assert step.error_message is None
開發者ID:behave,項目名稱:behave,代碼行數:10,代碼來源:test_model.py

示例3: test_run_sets_status_to_failed_on_assertion_error

# 需要導入模塊: from behave.model import Step [as 別名]
# 或者: from behave.model.Step import error_message [as 別名]
    def test_run_sets_status_to_failed_on_assertion_error(self):
        step = Step('foo.feature', 17, u'Given', 'given', u'foo')
        step.error_message = None
        match = Mock()
        match.run.side_effect = raiser(AssertionError('whee'))
        self.runner.step_registry.find_match.return_value = match
        step.run(self.runner)

        eq_(step.status, 'failed')
        assert step.error_message.startswith('Assertion Failed')
開發者ID:007jasonsmith,項目名稱:behave,代碼行數:12,代碼來源:test_model.py

示例4: test_run_sets_status_to_failed_on_exception

# 需要導入模塊: from behave.model import Step [as 別名]
# 或者: from behave.model.Step import error_message [as 別名]
    def test_run_sets_status_to_failed_on_exception(self, format_exc):
        step = Step('foo.feature', 17, u'Given', 'given', u'foo')
        step.error_message = None
        match = Mock()
        match.run.side_effect = raiser(Exception('whee'))
        self.runner.step_registry.find_match.return_value = match
        format_exc.return_value = 'something to do with an exception'

        step.run(self.runner)
        eq_(step.status, Status.failed)
        eq_(step.error_message, format_exc.return_value)
開發者ID:Abdoctor,項目名稱:behave,代碼行數:13,代碼來源:test_model.py

示例5: test_run_sets_status_to_failed_on_exception

# 需要導入模塊: from behave.model import Step [as 別名]
# 或者: from behave.model.Step import error_message [as 別名]
    def test_run_sets_status_to_failed_on_exception(self, format_exc):
        step = Step("foo.feature", 17, u"Given", "given", u"foo")
        step.error_message = None
        match = Mock()
        match.run.side_effect = raiser(Exception("whee"))
        self.runner.step_registry.find_match.return_value = match
        format_exc.return_value = "something to do with an exception"

        step.run(self.runner)
        assert step.status == Status.failed
        assert step.error_message == format_exc.return_value
開發者ID:behave,項目名稱:behave,代碼行數:13,代碼來源:test_model.py

示例6: test_run_sets_status_to_failed_on_assertion_error

# 需要導入模塊: from behave.model import Step [as 別名]
# 或者: from behave.model.Step import error_message [as 別名]
    def test_run_sets_status_to_failed_on_assertion_error(self):
        step = Step('foo.feature', 17, u'Given', 'given', u'foo')
        self.runner.context = Context(self.runner)
        self.runner.config.stdout_capture = True
        self.runner.config.log_capture = False
        self.runner.capture_controller = CaptureController(self.runner.config)
        self.runner.capture_controller.setup_capture(self.runner.context)
        step.error_message = None
        match = Mock()
        match.run.side_effect = raiser(AssertionError('whee'))
        self.runner.step_registry.find_match.return_value = match
        step.run(self.runner)

        eq_(step.status, Status.failed)
        assert step.error_message.startswith('Assertion Failed')
開發者ID:Abdoctor,項目名稱:behave,代碼行數:17,代碼來源:test_model.py

示例7: test_run_sets_status_to_failed_on_assertion_error

# 需要導入模塊: from behave.model import Step [as 別名]
# 或者: from behave.model.Step import error_message [as 別名]
    def test_run_sets_status_to_failed_on_assertion_error(self):
        step = Step("foo.feature", 17, u"Given", "given", u"foo")
        self.runner.context = Context(self.runner)
        self.runner.config.stdout_capture = True
        self.runner.config.log_capture = False
        self.runner.capture_controller = CaptureController(self.runner.config)
        self.runner.capture_controller.setup_capture(self.runner.context)
        step.error_message = None
        match = Mock()
        match.run.side_effect = raiser(AssertionError("whee"))
        self.runner.step_registry.find_match.return_value = match
        step.run(self.runner)

        assert step.status == Status.failed
        assert step.error_message.startswith("Assertion Failed")
開發者ID:behave,項目名稱:behave,代碼行數:17,代碼來源:test_model.py


注:本文中的behave.model.Step.error_message方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。