本文整理汇总了Python中unittest.TestCase.runTest方法的典型用法代码示例。如果您正苦于以下问题:Python TestCase.runTest方法的具体用法?Python TestCase.runTest怎么用?Python TestCase.runTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unittest.TestCase
的用法示例。
在下文中一共展示了TestCase.runTest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import runTest [as 别名]
form = open("form_deep_structure_template.html").read()
form = PeppercornForm(form, data=validated_data)
form.validate()
# XXX the following fails because nested lists end up copying
# templates when they shouldn't -- see 'parse_list' method of
# transformer
rendered = etree.fromstring(form.transform())
expected = rendered.xpath('//*[@class="error-message"]')[3]
self.assertEqual(expected.text, 'is required')
def test_different_schema_types(self):
"""Ensure we can refer to schemas by name or by instance
"""
schema = schemaish.Structure()
transformer.schema_registry = {'myschema': schema}
example1 = {'schema': 'myschema',
'data': {}}
example2 = {'schema': schema,
'data': {}}
# both of these should work
get_validated(example1)
get_validated(example2)
def runTest(self):
self.test_something()
if __name__ == "__main__":
test = TestCase()
test.runTest()