本文整理匯總了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")