当前位置: 首页>>代码示例>>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;未经允许,请勿转载。