本文整理汇总了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"