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


Python Fixture.get_status方法代碼示例

本文整理匯總了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
開發者ID:heynemann,項目名稱:pyccuracy,代碼行數:9,代碼來源:test_fixture.py

示例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()
開發者ID:andrewsmedina,項目名稱:pyccuracy,代碼行數:35,代碼來源:test_story_runner.py

示例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
開發者ID:Desperado,項目名稱:pyccuracy,代碼行數:32,代碼來源:test_story_runner.py

示例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
開發者ID:Desperado,項目名稱:pyccuracy,代碼行數:33,代碼來源:test_story_runner.py

示例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
開發者ID:heynemann,項目名稱:pyccuracy,代碼行數:12,代碼來源:test_fixture.py

示例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()
開發者ID:guilhermechapiewski,項目名稱:pyccuracy,代碼行數:18,代碼來源:test_story_runner.py

示例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()
開發者ID:guilhermechapiewski,項目名稱:pyccuracy,代碼行數:22,代碼來源:test_story_runner.py

示例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
開發者ID:heynemann,項目名稱:pyccuracy,代碼行數:5,代碼來源:test_fixture.py


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