本文整理汇总了Python中TestUnit类的典型用法代码示例。如果您正苦于以下问题:Python TestUnit类的具体用法?Python TestUnit怎么用?Python TestUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestUnit类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
test.write('exists', 'exists\n')
o = opts.options[0]
env = {'F':False, 'T':True, 'X':'x'}
exists = test.workpath('exists')
does_not_exist = test.workpath('does_not_exist')
o.validator('F', '/path', env)
o.validator('T', '/path', env)
o.validator('X', exists, env)
caught = None
try:
o.validator('X', does_not_exist, env)
except SCons.Errors.UserError:
caught = 1
assert caught, "did not catch expected UserError"
if __name__ == "__main__":
suite = unittest.makeSuite(PackageVariableTestCase, 'test_')
TestUnit.run(suite)
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
示例2: s
path = s.path(env)
deps = s(env.File('t1.idl'), env, path)
headers = ['f1.idl', 'f3.idl', 'd1/f2.idl']
deps_match(self, deps, headers)
def suite():
suite = unittest.TestSuite()
suite.addTest(IDLScannerTestCase1())
suite.addTest(IDLScannerTestCase2())
suite.addTest(IDLScannerTestCase3())
suite.addTest(IDLScannerTestCase4())
suite.addTest(IDLScannerTestCase5())
suite.addTest(IDLScannerTestCase6())
suite.addTest(IDLScannerTestCase7())
suite.addTest(IDLScannerTestCase8())
suite.addTest(IDLScannerTestCase9())
suite.addTest(IDLScannerTestCase10())
suite.addTest(IDLScannerTestCase11())
suite.addTest(IDLScannerTestCase12())
return suite
if __name__ == "__main__":
TestUnit.run(suite())
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4: