本文整理汇总了Python中net.grinder.script.Test.runTest方法的典型用法代码示例。如果您正苦于以下问题:Python Test.runTest方法的具体用法?Python Test.runTest怎么用?Python Test.runTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.grinder.script.Test
的用法示例。
在下文中一共展示了Test.runTest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from net.grinder.script import Test [as 别名]
# 或者: from net.grinder.script.Test import runTest [as 别名]
def __call__(self):
# Turn off automatic reporting for the current worker thread.
# Having done this, the script can modify or set the statistics
# before they are sent to the log and the console.
grinder.statistics.delayReports = 1
# Creates a Test Suite.
suite = TestSuite(VoCardRequestServiceTest().getClass());
suite.addTestSuite(ElectoralRollRegistrationRequestServiceTest().getClass());
suite.addTestSuite(RequestServiceTest().getClass());
suite.addTestSuite(DocumentServiceTest().getClass());
suite.addTestSuite(FakeExternalServiceTest().getClass());
suite.addTestSuite(LocalReferentialServiceTest().getClass());
suite.addTestSuite(CategoryServiceTest().getClass());
#suite.addTestSuite(HomeFolderModificationRequestServiceTest().getClass());
# Returns the tests as an enumeration.
tests = suite.tests();
# Iterate over the tests.
testNumber = 0
for test in tests:
testNumber += 1
testCase = Test(testNumber, test.getName()).wrap(suite)
testResult = TestResult()
testCase.runTest(test, testResult)
if testResult.errorCount() > 0:
grinder.statistics.success = 0
elif testResult.failureCount() > 0:
grinder.statistics.success = 0