本文整理汇总了Python中tests.functional.test_runner.feature_name函数的典型用法代码示例。如果您正苦于以下问题:Python feature_name函数的具体用法?Python feature_name怎么用?Python feature_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了feature_name函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_subunit_output_with_tags
def test_subunit_output_with_tags():
"""
Test Subunit output with tags
"""
state.expect = [
Includes({
'status': 'success',
'tags': set(['slow-ish']),
}),
Includes({
'status': 'success',
'tags': set(['fast-ish']),
}),
Includes({
'status': 'success',
'tags': set(),
}),
Includes({
'status': 'success',
'tags': set(),
}),
]
runner = Runner(feature_name('tagged_features'), enable_subunit=True)
runner.run()
开发者ID:DrManchas,项目名称:lettuce,代码行数:26,代码来源:test_subunit_output.py
示例2: test_subunit_output_undefined_steps
def test_subunit_output_undefined_steps():
"""
Test Subunit output with undefined steps
"""
state.expect = [
Includes({
'status': 'fail',
'details': Includes({
'steps': ContentContains(
'? When this test step is undefined\n'),
}),
}),
Includes({
'status': 'fail',
'details': Includes({
'steps': ContentContains(
'? When this test step is undefined\n'),
}),
}),
]
with assert_raises(SystemExit):
runner = Runner(feature_name('undefined_steps'), enable_subunit=True)
runner.run()
开发者ID:raitisdembovskis,项目名称:lettuce,代码行数:25,代码来源:test_subunit_output.py
示例3: test_xunit_output_with_one_error
def test_xunit_output_with_one_error():
'Test xunit output with one errors'
called = []
def assert_correct_xml(filename, content):
called.append(True)
assert_xsd_valid(filename, content)
root = etree.fromstring(content)
assert_equals(root.get("tests"), "2")
assert_equals(root.get("failures"), "1")
assert_equals(len(root.getchildren()), 2)
passed, failed = root.findall("testcase")
assert_equals(passed.get("name"), "Given my step that passes")
assert_true(float(passed.get("time")) > 0)
assert_equals(failed.get("name"), "Given my step that blows a exception")
assert_true(float(failed.get("time")) > 0)
assert_true(failed.find("failure") is not None)
old = xunit_output.wrt_output
xunit_output.wrt_output = assert_correct_xml
runner = Runner(feature_name('error_traceback'), enable_xunit=True)
runner.run()
assert_equals(1, len(called), "Function not called")
xunit_output.wrt_output = old
开发者ID:datapotluck1,项目名称:lettuce,代码行数:25,代码来源:test_xunit_output.py
示例4: test_jsonreport_output_with_different_filename
def test_jsonreport_output_with_different_filename():
'Test jsonreport output with different filename'
with check_jsonreport('error_traceback', "custom_filename.json"):
runner = Runner(
feature_name('error_traceback'), enable_jsonreport=True,
jsonreport_filename="custom_filename.json"
)
runner.run()
开发者ID:MikeHibbert,项目名称:lettuce,代码行数:8,代码来源:test_jsonreport_output.py
示例5: run_check
def run_check(name, assert_fcn, output_filename):
runner = Runner(feature_name(name), bunch_output_file=output_filename)
original_wrt_fcn = bunch_output.write_output
bunch_output.write_output = assert_fcn
try:
runner.run()
finally:
bunch_output.write_output = original_wrt_fcn
开发者ID:skosyrev,项目名称:lettuce,代码行数:8,代码来源:test_bunch_output.py
示例6: test_xunit_does_not_throw_exception_when_missing_step_definition
def test_xunit_does_not_throw_exception_when_missing_step_definition():
def dummy_write(filename, content):
pass
old = xunit_output.wrt_output
xunit_output.wrt_output = dummy_write
runner = Runner(feature_name('missing_steps'), enable_xunit=True,
xunit_filename="mising_steps.xml")
runner.run()
xunit_output.wrt_output = old
开发者ID:EliezerCruz,项目名称:lettuce,代码行数:11,代码来源:test_xunit_output.py
示例7: test_xunit_output_with_unicode_characters_in_error_messages
def test_xunit_output_with_unicode_characters_in_error_messages():
called = []
def assert_correct_xml(filename, content):
called.append(True)
assert_xsd_valid(filename, content)
old = xunit_output.wrt_output
xunit_output.wrt_output = assert_correct_xml
runner = Runner(feature_name('unicode_traceback'), enable_xunit=True,
xunit_filename="custom_filename.xml")
runner.run()
assert_equals(1, len(called), "Function not called")
xunit_output.wrt_output = old
开发者ID:EliezerCruz,项目名称:lettuce,代码行数:14,代码来源:test_xunit_output.py
示例8: test_xunit_output_with_outline
def test_xunit_output_with_outline():
'Test xunit output with different filename'
called = []
def assert_correct_xml(filename, content):
called.append(True)
assert_equals(filename, "custom_filename.xml")
old = xunit_output.wrt_output
xunit_output.wrt_output = assert_correct_xml
runner = Runner(feature_name('fail_outline'), enable_xunit=True,
xunit_filename="custom_filename.xml")
runner.run()
assert_equals(1, len(called), "Function not called")
xunit_output.wrt_output = old
开发者ID:skosyrev,项目名称:lettuce,代码行数:15,代码来源:test_xunit_output.py
示例9: test_subunit_output_with_no_errors
def test_subunit_output_with_no_errors():
"""
Test Subunit output with no errors
"""
state.expect = [
Includes({
'id': 'one commented scenario: Do nothing',
'status': 'success',
'details': Keys('stdout', 'stderr', 'steps'),
}),
]
runner = Runner(feature_name('commented_feature'), enable_subunit=True)
runner.run()
开发者ID:DrManchas,项目名称:lettuce,代码行数:15,代码来源:test_subunit_output.py
示例10: test_xunit_xml_output_with_no_errors
def test_xunit_xml_output_with_no_errors():
'Test xunit doc xml output'
called = []
def assert_correct_xml_output(filename, doc):
called.append(True)
expect(doc.toxml).when.called.doesnt.throw(UnicodeDecodeError)
old = xunit_output.write_xml_doc
xunit_output.write_xml_doc = assert_correct_xml_output
runner = Runner(feature_name('xunit_unicode_and_bytestring_mixing'), enable_xunit=True)
try:
runner.run()
finally:
xunit_output.write_xml_doc = old
开发者ID:rpaloschi,项目名称:lettuce,代码行数:16,代码来源:test_xunit_output.py
示例11: test_xunit_output_with_different_filename
def test_xunit_output_with_different_filename():
"Test xunit output with different filename"
called = []
def assert_correct_xml(filename, content):
called.append(True)
assert_xsd_valid(filename, content)
assert_equals(filename, "custom_filename.xml")
old = xunit_output.wrt_output
xunit_output.wrt_output = assert_correct_xml
runner = Runner(feature_name("error_traceback"), enable_xunit=True, xunit_filename="custom_filename.xml")
runner.run()
assert_equals(1, len(called), "Function not called")
xunit_output.wrt_output = old
开发者ID:njwilson,项目名称:lettuce,代码行数:16,代码来源:test_xunit_output.py
示例12: test_xunit_output_with_no_errors
def test_xunit_output_with_no_errors():
'Test xunit output with no errors'
called = []
def assert_correct_xml(filename, content):
called.append(True)
root = etree.fromstring(content)
assert_equals(root.get("tests"), "1")
assert_equals(len(root.getchildren()), 1)
assert_equals(root.find("testcase").get("name"), "Given I do nothing")
assert_true(float(root.find("testcase").get("time")) > 0)
old = xunit_output.wrt_output
xunit_output.wrt_output = assert_correct_xml
runner = Runner(feature_name('commented_feature'), enable_xunit=True)
runner.run()
assert_equals(1, len(called), "Function not called")
xunit_output.wrt_output = old
开发者ID:skosyrev,项目名称:lettuce,代码行数:18,代码来源:test_xunit_output.py
示例13: test_subunit_output_with_one_error
def test_subunit_output_with_one_error():
"""
Test Subunit output with one error
"""
state.expect = [
Includes({
'status': 'success',
'details': Keys('stdout', 'stderr', 'steps'),
}),
Includes({
'status': 'fail',
'details': Keys('stdout', 'stderr', 'traceback', 'steps'),
}),
]
runner = Runner(feature_name('error_traceback'), enable_subunit=True)
runner.run()
开发者ID:DrManchas,项目名称:lettuce,代码行数:18,代码来源:test_subunit_output.py
示例14: test_subunit_output_unicode
def test_subunit_output_unicode():
"""
Test Subunit output with unicode traceback
"""
state.expect = [
Includes({
'status': 'success',
}),
Includes({
'status': 'fail',
'details': Includes({
'traceback': ContentContains('given_my_daemi_that_blows_a_exception'),
}),
}),
]
runner = Runner(feature_name('unicode_traceback'), enable_subunit=True)
runner.run()
开发者ID:DrManchas,项目名称:lettuce,代码行数:19,代码来源:test_subunit_output.py
示例15: test_xunit_xml_output_with_mixed_unicode
def test_xunit_xml_output_with_mixed_unicode():
"""Test xunit doc xml output"""
called = []
def assert_correct_xml_output(filename, doc):
called.append(True)
expect(doc.toxml).when.called.doesnt.throw(UnicodeDecodeError)
old = xunit_output.write_xml_doc
xunit_output.write_xml_doc = assert_correct_xml_output
runner = Runner(feature_name('xunit_unicode_and_bytestring_mixing'),
enable_xunit=True,
verbosity=2)
with assert_raises(SystemExit):
runner.run()
xunit_output.write_xml_doc = old
开发者ID:raitisdembovskis,项目名称:lettuce,代码行数:19,代码来源:test_xunit_output.py
示例16: test_xunit_output_with_no_steps
def test_xunit_output_with_no_steps():
'Test xunit output with no steps'
called = []
def assert_correct_xml(filename, content):
called.append(True)
assert_xsd_valid(filename, content)
root = etree.fromstring(content)
assert_equals(root.get("tests"), "1")
assert_equals(root.find("testcase").get("name"), "Given I do nothing")
assert_equals(len(root.getchildren()), 1)
assert_equals(root.find("testcase/skipped").get("type"), "UndefinedStep(Given I do nothing)")
assert_equals(float(root.find("testcase").get("time")), 0)
old = xunit_output.wrt_output
xunit_output.wrt_output = assert_correct_xml
runner = Runner(feature_name('no_steps_defined'), enable_xunit=True)
runner.run()
assert_equals(1, len(called), "Function not called")
xunit_output.wrt_output = old
开发者ID:rpaloschi,项目名称:lettuce,代码行数:20,代码来源:test_xunit_output.py
示例17: test_subunit_output_console
def test_subunit_output_console():
"""
Test Subunit output to console
"""
state.expect = [
Includes({
'status': 'success',
'details': Includes({
'stdout': ContentContains('Badger'),
}),
}),
Includes({
'status': 'success',
'details': Includes({
'stderr': ContentContains('Mushroom'),
}),
}),
]
runner = Runner(feature_name('writes_to_console'), enable_subunit=True)
runner.run()
开发者ID:DrManchas,项目名称:lettuce,代码行数:22,代码来源:test_subunit_output.py
示例18: test_jsonreport_output_with_no_steps
def test_jsonreport_output_with_no_steps():
'Test jsonreport output with no steps'
with check_jsonreport('missing_steps'):
runner = Runner(feature_name('missing_steps'), enable_jsonreport=True)
runner.run()
开发者ID:MikeHibbert,项目名称:lettuce,代码行数:5,代码来源:test_jsonreport_output.py
示例19: test_xunit_does_not_throw_exception_when_missing_step_definition
def test_xunit_does_not_throw_exception_when_missing_step_definition():
with check_jsonreport('missing_steps'):
runner = Runner(feature_name('missing_steps'), enable_jsonreport=True)
runner.run()
开发者ID:MikeHibbert,项目名称:lettuce,代码行数:4,代码来源:test_jsonreport_output.py
示例20: test_jsonreport_output_with_unicode_characters_in_error_messages
def test_jsonreport_output_with_unicode_characters_in_error_messages():
with check_jsonreport('unicode_traceback'):
runner = Runner(feature_name('unicode_traceback'), enable_jsonreport=True)
runner.run()
开发者ID:MikeHibbert,项目名称:lettuce,代码行数:4,代码来源:test_jsonreport_output.py
注:本文中的tests.functional.test_runner.feature_name函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论