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