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


Python FileParser.parse_scenario_line方法代碼示例

本文整理匯總了Python中pyccuracy.parsers.FileParser.parse_scenario_line方法的典型用法代碼示例。如果您正苦於以下問題:Python FileParser.parse_scenario_line方法的具體用法?Python FileParser.parse_scenario_line怎麽用?Python FileParser.parse_scenario_line使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyccuracy.parsers.FileParser的用法示例。


在下文中一共展示了FileParser.parse_scenario_line方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_parse_scenario_line

# 需要導入模塊: from pyccuracy.parsers import FileParser [as 別名]
# 或者: from pyccuracy.parsers.FileParser import parse_scenario_line [as 別名]
def test_parse_scenario_line():
    story = Story(as_a="Someone", i_want_to="Do Something", so_that="I'm Happy", identity="some file")

    settings_mock = Mock()
    settings_mock.scenarios_to_run = []

    language_mock = Mock()
    language_mock.expects(once()) \
                 .get(eq("scenario")) \
                 .will(return_value("Scenario")) \

    parser = FileParser(language=language_mock, file_object=None)
    scenario = parser.parse_scenario_line(story, "Scenario 1 - Doing something", settings_mock)

    assert scenario is not None
    assert scenario.index == "1", "Expected 1 actual %s" % scenario.index
    assert scenario.title == "Doing something"

    language_mock.verify()
開發者ID:andrewsmedina,項目名稱:pyccuracy,代碼行數:21,代碼來源:test_file_parser.py

示例2: test_parse_scenario_line

# 需要導入模塊: from pyccuracy.parsers import FileParser [as 別名]
# 或者: from pyccuracy.parsers.FileParser import parse_scenario_line [as 別名]
def test_parse_scenario_line():
    
    mocker = Mocker()
    
    story = Story(as_a="Someone", i_want_to="Do Something", so_that="I'm Happy", identity="some file")

    settings_mock = mocker.mock()
    settings_mock.scenarios_to_run
    mocker.result([])
    
    language_mock = mocker.mock()
    language_mock.get("scenario")
    mocker.result("Scenario")

    with mocker:
        parser = FileParser(language=language_mock, file_object=None)
        scenario = parser.parse_scenario_line(story, "Scenario 1 - Doing something", settings_mock)
    
        assert scenario is not None
        assert scenario.index == "1", "Expected 1 actual %s" % scenario.index
        assert scenario.title == "Doing something"
開發者ID:Desperado,項目名稱:pyccuracy,代碼行數:23,代碼來源:test_file_parser.py


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