本文整理汇总了Python中pyccuracy.fixture.Fixture.get_status方法的典型用法代码示例。如果您正苦于以下问题:Python Fixture.get_status方法的具体用法?Python Fixture.get_status怎么用?Python Fixture.get_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyccuracy.fixture.Fixture
的用法示例。
在下文中一共展示了Fixture.get_status方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_fixture_returns_proper_status_if_action_succeeded
# 需要导入模块: from pyccuracy.fixture import Fixture [as 别名]
# 或者: from pyccuracy.fixture.Fixture import get_status [as 别名]
def test_fixture_returns_proper_status_if_action_succeeded():
fixture = Fixture()
action = some_action()
fixture.append_story(action.scenario.story)
action.mark_as_successful()
assert fixture.get_status() == Status.Successful
示例2: test_should_execute_scenarios_successfully
# 需要导入模块: from pyccuracy.fixture import Fixture [as 别名]
# 或者: from pyccuracy.fixture.Fixture import get_status [as 别名]
def test_should_execute_scenarios_successfully():
settings = Settings()
runner = StoryRunner()
fixture = Fixture()
fixture.append_story(some_action().scenario.story)
context = Mock()
context.browser_driver = Mock()
context.browser_driver.expects(once()).start_test(eq("http://localhost"))
context.browser_driver.expects(once()).stop_test()
context.settings = Mock()
context.settings.on_before_action = None
context.settings.on_action_successful = None
context.settings.on_action_error = None
context.language = Mock()
context.language \
.expects(once()) \
.get(eq('given')) \
.will(return_value('Given'))
context.language \
.expects(once()) \
.get(eq('when')) \
.will(return_value('When'))
context.language \
.expects(once()) \
.get(eq('then')) \
.will(return_value('Then'))
result = runner.run_stories(settings=settings, fixture=fixture, context=context)
assert fixture.get_status() == Status.Successful
context.verify()
context.browser_driver.verify()
示例3: test_should_handle_action_errors_successfully
# 需要导入模块: from pyccuracy.fixture import Fixture [as 别名]
# 或者: from pyccuracy.fixture.Fixture import get_status [as 别名]
def test_should_handle_action_errors_successfully():
mocker = Mocker()
def action_failed_method(context, *args, **kwargs):
raise ActionFailedError("bla")
settings = Settings()
runner = StoryRunner()
fixture = Fixture()
action = some_action()
fixture.append_story(action.scenario.story)
action.execute_function = action_failed_method
context = Object()
context.browser_driver = mocker.mock()
context.browser_driver.start_test("http://localhost")
context.browser_driver.stop_test()
context.settings = mocker.mock()
context.settings.on_before_action
mocker.result(None)
context.settings.on_action_error
mocker.result(None)
context.language = mocker.mock()
context.language.get('given')
mocker.result('Given')
with mocker:
result = runner.run_stories(settings=settings, fixture=fixture, context=context)
assert fixture.get_status() == Status.Failed
示例4: test_should_execute_scenarios_successfully
# 需要导入模块: from pyccuracy.fixture import Fixture [as 别名]
# 或者: from pyccuracy.fixture.Fixture import get_status [as 别名]
def test_should_execute_scenarios_successfully():
mocker = Mocker()
settings = Settings()
runner = StoryRunner()
fixture = Fixture()
fixture.append_story(some_action().scenario.story)
context = Object()
context.browser_driver = mocker.mock()
context.browser_driver.start_test("http://localhost")
context.browser_driver.stop_test()
context.settings = mocker.mock()
context.settings.on_before_action
mocker.result(None)
context.settings.on_action_successful
mocker.result(None)
context.language = mocker.mock()
context.language.get('given')
mocker.result('Given')
context.language.get('when')
mocker.result('When')
context.language.get('then')
mocker.result('Then')
with mocker:
result = runner.run_stories(settings=settings, fixture=fixture, context=context)
assert fixture.get_status() == Status.Successful
示例5: test_fixture_returns_proper_status_with_two_scenarios_with_both_successful
# 需要导入模块: from pyccuracy.fixture import Fixture [as 别名]
# 或者: from pyccuracy.fixture.Fixture import get_status [as 别名]
def test_fixture_returns_proper_status_with_two_scenarios_with_both_successful():
fixture = Fixture()
action = some_action()
other_action = some_action()
fixture.append_story(action.scenario.story)
fixture.append_story(other_action.scenario.story)
action.mark_as_successful()
other_action.mark_as_successful()
assert fixture.get_status() == Status.Successful
示例6: test_should_execute_scenarios_successfully
# 需要导入模块: from pyccuracy.fixture import Fixture [as 别名]
# 或者: from pyccuracy.fixture.Fixture import get_status [as 别名]
def test_should_execute_scenarios_successfully():
settings = Settings()
runner = StoryRunner()
fixture = Fixture()
fixture.append_story(some_action().scenario.story)
context = Mock()
context.browser_driver = Mock()
context.browser_driver.expects(once()).start_test(eq("http://localhost"))
context.browser_driver.expects(once()).stop_test()
result = runner.run_stories(settings=settings, fixture=fixture, context=context)
assert fixture.get_status() == Status.Successful
context.verify()
context.browser_driver.verify()
示例7: test_should_handle_action_errors_successfully
# 需要导入模块: from pyccuracy.fixture import Fixture [as 别名]
# 或者: from pyccuracy.fixture.Fixture import get_status [as 别名]
def test_should_handle_action_errors_successfully():
def action_failed_method(context, *args, **kwargs):
raise ActionFailedError("bla")
settings = Settings()
runner = StoryRunner()
fixture = Fixture()
action = some_action()
fixture.append_story(action.scenario.story)
action.execute_function = action_failed_method
context = Mock()
context.browser_driver = Mock()
context.browser_driver.expects(once()).start_test(eq("http://localhost"))
context.browser_driver.expects(once()).stop_test()
result = runner.run_stories(settings=settings, fixture=fixture, context=context)
assert fixture.get_status() == Status.Failed
context.verify()
context.browser_driver.verify()
示例8: test_fixture_returns_unknown_status_if_no_stories
# 需要导入模块: from pyccuracy.fixture import Fixture [as 别名]
# 或者: from pyccuracy.fixture.Fixture import get_status [as 别名]
def test_fixture_returns_unknown_status_if_no_stories():
fixture = Fixture()
assert fixture.get_status() == Status.Unknown