本文整理汇总了Python中testoob.main函数的典型用法代码示例。如果您正苦于以下问题:Python main函数的具体用法?Python main怎么用?Python main使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了main函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: run_tests
def run_tests(verbosity=1):
try:
# Support for testoob to have nice colored output
import testoob
testoob.main(suite())
except ImportError:
runner = unittest.TextTestRunner(verbosity=verbosity)
runner.run(suite())
开发者ID:horvatha,项目名称:mfng,代码行数:8,代码来源:__init__.py
示例2: run_test
def run_test(prefix='test'):
try:
import testoob
testoob.main()
except ImportError:
loader = unittest.defaultTestLoader
loader.testMethodPrefix = prefix
unittest.main(testLoader = loader)
开发者ID:jangxyz,项目名称:pyeature,代码行数:8,代码来源:env.py
示例3: abspath
mock_frame.f_code.co_filename = abspath("one.py")
mock_frame.f_lineno = 1000 # out of the range of one.py's lines
self.failIf( self.coverage._should_cover_frame(mock_frame) )
def test_single_file_statistics(self):
coverage_dict = {
"lines" : range(10),
"covered" : range(5)
}
result = self.coverage._single_file_statistics(coverage_dict)
self.assertEqual( 10, result["lines"] )
self.assertEqual( 5, result["covered"] )
self.assertEqual( 50, result["percent"] )
class system_tests(CoverageTest):
"Large-grain tests for Coverage"
def test_percentage_full(self):
if not testoob.capabilities.c.settrace:
testoob.testing.skip("requires sys.settrace")
if not testoob.capabilities.c.trace_coverage_support(sample.__file__.replace(".pyc", ".py")):
testoob.testing.skip("requires coverage support from trace")
self.coverage.runfunc(sample.foo, 5)
self.assertEqual( 100, self.coverage.total_coverage_percentage() )
if __name__ == "__main__":
import testoob
testoob.main()
开发者ID:algard,项目名称:testoob,代码行数:30,代码来源:test_coverage.py
示例4: suites
from user_blob_delete import *
from user_blob_revert_golden import *
from user_history_get import *
from meta_threshold_get import *
from reputation_get import *
from payments_meta_get import *
from reputation_update import *
def suites():
suite =unittest.TestSuite()
suite.addTest(unittest.makeSuite(golden_revert_class))
suite.addTest(unittest.makeSuite(blob_delete_class))
suite.addTest(unittest.makeSuite(history_get_class))
suite.addTest(unittest.makeSuite(meta_threshold_get))
suite.addTest(unittest.makeSuite(reputation_get))
suite.addtest(unittest.makesuite(admin_payments_get_class))
suite.addtest(unittest.makesuite(admin_reputation_update))
if __name__ == '__main__':
import testoob
from testoob.reporting import HTMLReporter
testoob.main(html='/opt/zynga/greyhound/current/tests/scripts/test/results/admin_unit.html')
开发者ID:muttu2244,项目名称:MyPython,代码行数:23,代码来源:Admin_unit.py
示例5: suite
import unittest
from clientCalls import *
def suite():
""" This defines all the tests of a module"""
suite =unittest.TestSuite()
suite.addTest(unittest.makeSuite(clientCalls))
return suite
#if __name__ == '__main__':
# unittest.TextTestRunner(verbosity=2).run(suite())
if __name__ == '__main__':
import testoob
from testoob.reporting import HTMLReporter
testoob.main(html='istorage.html', xml='istorage.xml')
开发者ID:muttu2244,项目名称:MyPython,代码行数:18,代码来源:requestsSuite.py
示例6: MyTestProgram
return jcl.tests.suite()
if __name__ == '__main__':
class MyTestProgram(unittest.TestProgram):
def runTests(self):
"""run tests but do not exit after"""
self.testRunner = unittest.TextTestRunner(verbosity=self.verbosity)
self.testRunner.run(self.test)
logger = logging.getLogger()
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.CRITICAL)
try:
print "Trying to launch test with testoob"
import testoob
testoob.main(defaultTest='suite')
except ImportError:
print "Falling back to standard unittest"
MyTestProgram(defaultTest='suite')
coverage.report(["src/jcl/__init__.py",
"src/jcl/lang.py",
"src/jcl/runner.py",
"src/jcl/error.py",
"src/jcl/jabber/__init__.py",
"src/jcl/jabber/component.py",
"src/jcl/jabber/command.py",
"src/jcl/jabber/feeder.py",
"src/jcl/jabber/message.py",
"src/jcl/jabber/presence.py",
"src/jcl/jabber/disco.py",
开发者ID:dax,项目名称:jcl,代码行数:31,代码来源:run_tests.py
示例7: test_user_blob_deleteDeltas_expired_auth
zauth = AuthSystem.getUntrustedToken(Constants.ZID)
user_query = {Constants.USER_QUERY: Constants.SELF_QUERY , "params": {"type": Constants.DELTATYPE}}
ret,result = self.check_pass(user_blob_queryDeltas , [zauth , user_query])
delta_id = []
for item in result['deltas']:
delta_id.append(item['delta_id'])
ids = ",".join(delta_id)
zauth = AuthSystem.getReadonlyToken(Constants.ZID)
ret,result = self.check_fail(user_blob_deleteDeltas , [zauth , ids])
def test_user_blob_deleteDeltas_expired_auth(self):
zauth = AuthSystem.getUntrustedToken(Constants.ZID)
user_query = {Constants.USER_QUERY: Constants.SELF_QUERY , "params": {"type": Constants.DELTATYPE}}
ret,result = self.check_pass(user_blob_queryDeltas , [zauth , user_query])
delta_id = []
for item in result['deltas']:
delta_id.append(item['delta_id'])
ids = ",".join(delta_id)
zauth = AuthSystem.getExpiredToken(Constants.ZID)
ret,result = self.check_fail(user_blob_deleteDeltas , [zauth , ids])
if __name__ == '__main__':
#suite0 = unittest.TestLoader().loadTestsFromTestCase(iauth_unit)
#unittest.TextTestRunner(verbosity=99).run(suite0)
import testoob
from testoob.reporting import HTMLReporter
testoob.main(html='/opt/zynga/greyhound/current/gh_test/scripts/test/results/iauth.html')
开发者ID:muttu2244,项目名称:MyPython,代码行数:29,代码来源:iauth_unit.py
示例8: suite
These tests should require no network or disk access and run on just about
any system.
"""
import sys
import unittest
sys.path.insert(0, '../')
sys.path.insert(0, './suites')
sys.path.insert(0, '../../client/rhel/rhnlib')
# Import all test modules here:
import rhnsqltests
def suite():
# Append all test suites here:
return unittest.TestSuite((
rhnsqltests.suite(),
))
if __name__ == "__main__":
try:
import testoob
testoob.main(defaultTest="suite")
except ImportError:
print "These tests would run prettier if you install testoob. :)"
unittest.main(defaultTest="suite")
开发者ID:T-D-Oe,项目名称:spacewalk,代码行数:29,代码来源:runtests.py
示例9: runJobAndWait
for item in self.input[constants.ACSKEY_GOLDEN]:
if item['type'] == 'new-world':
found = True
self.input['golden'].remove(item)
break
if not found:
self.input[constants.ACSKEY_GOLDEN].append({"type": "new-world"})
ob = self._processTest(self.input)
runJobAndWait()
status, ret = ob.checkStorageYaml()
self.assertTrue(status, msg=ret)"""
def _processTest(self, data ):
status, ret = sendRequest(self.url, data)
self.assertTrue(status, msg=ret)
obj = compareFiles(self.input)
return obj
def _getDataFromServer(self, data):
status, ret = sendRequest(self.url, data)
self.assertTrue(status, msg=ret)
return ret
if __name__ == '__main__':
#suite0 = unittest.TestLoader().loadTestsFromTestCase(configAdd)
#unittest.TextTestRunner(verbosity=99).run(suite0)
import testoob
from testoob.reporting import HTMLReporter
testoob.main(html='ConfigAdd.html')
开发者ID:muttu2244,项目名称:MyPython,代码行数:30,代码来源:add.py
示例10: data_to_post
else:
cas = result[ Constants.BLOBS ][ Constants.USER_BLOB ][ Constants.GH_CAS ]
data = data_to_post()
ret, result = self.check_pass(user_blob_set, [ zauth, Constants.USER_BLOB, data, cas ],[0])
oldFile = diff_path + '/old.txt'
f = open(oldFile,'wb+')
f.write(data)
f.close()
result = user_blob_get(zauth)
newFile = diff_path + '/new.txt'
f = open(newFile,'wb+')
f.write(os.urandom(100))
f.close()
cas = result[ Constants.BLOBS ][ Constants.USER_BLOB ][ Constants.GH_CAS ]
checksum = diff_data_post(diff_path,oldFile,newFile)
zauth = AuthSystem.getImpersonatedAuthToken(Constants.ZID) #Impersonated token
ret, result = self.check_pass(user_blob_patch, [ zauth, Constants.USER_BLOB, "%s/out.zcdiff"%diff_path, cas,checksum ],[0])
self.assertTrue(ret, msg='Failed to send API request')
os.system('rm %s/out.zcdiff'%diff_path)
if __name__ == '__main__':
suite0 = unittest.TestLoader().loadTestsFromTestCase(blob_diff)
unittest.TextTestRunner(verbosity=99).run(suite0)
import testoob
from testoob.reporting import HTMLReporter
testoob.main(html='/opt/zynga/greyhound/current/tests/scripts/test/results/blob_delta.html')
开发者ID:muttu2244,项目名称:MyPython,代码行数:29,代码来源:blob_diff.py
示例11: suites
import unittest
def suites():
suite =unittest.TestSuite()
suite.addTest(unittest.makeSuite(archive_fetch))
suite.addTest(unittest.makeSuite(archive_queue_update))
suite.addTest(unittest.makeSuite(credibility_get))
suite.addTest(unittest.makeSuite(dau_fetch))
suite.addTest(unittest.makeSuite(dau_update_class))
suite.addTest(unittest.makeSuite(fraud_update_class))
suite.addTest(unittest.makeSuite(history_update))
suite.addTest(unittest.makeSuite(meta_threshold_get))
suite.addTest(unittest.makeSuite(payments_get_class))
suite.addTest(unittest.makeSuite(reputation_get))
suite.addTest(unittest.makeSuite(reputation_update))
suite.addTest(unittest.makeSuite(thresholds_fetch))
suite.addTest(unittest.makeSuite(thresholds_update))
suite.addTest(unittest.makeSuite(archive_blob))
suite.addTest(unittest.makeSuite(revert_blob))
suite.addTest(unittest.makeSuite(blob_delete_class))
suite.addTest(unittest.makeSuite(golden_update_class))
suite.addTest(unittest.makeSuite(history_get_class))
suite.addTest(unittest.makeSuite(golden_revert_class))
return suite
if __name__ == '__main__':
import testoob
from testoob.reporting import HTMLReporter
testoob.main(html='internal.html')
unittest.TextTestRunner(verbosity=99).run(suites())
开发者ID:muttu2244,项目名称:MyPython,代码行数:30,代码来源:internal_unit.py
示例12: testRetrieveRecipeBasedOnID
def testRetrieveRecipeBasedOnID(self):
pass
if __name__ == '__main__':
unittest.main()
suite0 = unittest.TestLoader().loadTestsFromTestCase(MyReqTests)
unittest.TextTestRunner(verbosity=99).run(suite0)
import testoob
from testoob.reporting import HTMLReporter
testoob.main(html='D:\\PI2.2Iteration\\PythonRestClientRequest\\restRequests.html',xml='D:\\PI2.2Iteration\\PythonRestClientRequest\\restRequests.xml')
#testoob.main(suite0)
"""
suite.addTests([
unittest.TestLoader().loadTestsFromTestCase(cMSHParseTest),
unittest.TestLoader().loadTestsFromTestCase(dPIDParseTest),
unittest.TestLoader().loadTestsFromTestCase(ePVParseTest),
unittest.TestLoader().loadTestsFromTestCase(fEVNParseTest),
])
"""
"""
开发者ID:muttu2244,项目名称:MyPython,代码行数:31,代码来源:retrieveRecipe.py
示例13: suite
import unittest
import testoob
from mqs_auth import mqs_auth
from mqs_graph_auth import mqs_graph_auth
from mqs_graph_testcases import mqs_graph_testcases
from mqs_meta_testcases import mqs_meta_testcases
def suite():
suite = unittest.TestSuite()
suite.addTests(unittest.makeSuite(mqs_auth))
suite.addTests(unittest.makeSuite(mqs_graph_auth))
suite.addTests(unittest.makeSuite(mqs_graph_testcases))
suite.addTests(unittest.makeSuite(mqs_meta_testcases))
return suite
if __name__ == '__main__':
import testoob
suite()
from testoob.reporting import HTMLReporter
testoob.main(html='mqs.html', xml='mqs.xml')
开发者ID:muttu2244,项目名称:MyPython,代码行数:20,代码来源:main.py
示例14: sendRequest
status, ret = sendRequest(self.url, self.input)
self.assertFalse(status, msg=ret)
self.assertTrue(ret == constants.ERROR_INTERNAL, msg=ret)
def test_invalidMax(self):
self.input[constants.ACSKEY_SCOREBOARD][0]['max'] = '12k'
status, ret = sendRequest(self.url, self.input)
self.assertFalse(status, msg=ret)
self.assertTrue(ret == constants.ERROR_INTERNAL, msg=ret)
def _processTest(self, data ):
status, ret = sendRequest(self.url, data)
self.assertTrue(status, msg=ret)
obj = compareFiles(self.input)
return obj
def _getDataFromServer(self, data):
status, ret = sendRequest(self.url, data)
self.assertTrue(status, msg=ret)
return ret
if __name__ == '__main__':
#suite0 = unittest.TestLoader().loadTestsFromTestCase(configSet)
#unittest.TextTestRunner(verbosity=99).run(suite0)
import testoob
from testoob.reporting import HTMLReporter
testoob.main(html='FormatChecks.html')
开发者ID:muttu2244,项目名称:MyPython,代码行数:30,代码来源:formatChecks.py
示例15: __import__
# -*- coding: utf-8 -*-
import os
import unittest
import testoob
#import testlib
if __name__ == "__main__":
testdir = os.path.split(__file__)[0]
testfiles = [ f[:-3] for f in os.listdir(testdir or '.') \
if f.startswith('test_') and f.endswith('.py') ]
modules = [ __import__(file) for file in testfiles ]
test_loader = unittest.TestLoader()
tests = [ test_loader.loadTestsFromModule(module) for module in modules ]
testoob.main(unittest.TestSuite(tests))
开发者ID:drdivano,项目名称:test,代码行数:17,代码来源:test.py
注:本文中的testoob.main函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论