本文整理汇总了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)
示例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
示例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')
示例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)
示例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
示例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')
示例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")