本文整理匯總了Python中WMQuality.WebTools.RESTServerSetup.DefaultConfig.setDBUrl方法的典型用法代碼示例。如果您正苦於以下問題:Python DefaultConfig.setDBUrl方法的具體用法?Python DefaultConfig.setDBUrl怎麽用?Python DefaultConfig.setDBUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WMQuality.WebTools.RESTServerSetup.DefaultConfig
的用法示例。
在下文中一共展示了DefaultConfig.setDBUrl方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: WorkQueueTest
# 需要導入模塊: from WMQuality.WebTools.RESTServerSetup import DefaultConfig [as 別名]
# 或者: from WMQuality.WebTools.RESTServerSetup.DefaultConfig import setDBUrl [as 別名]
class WorkQueueTest(RESTBaseUnitTest):
"""
Test WorkQueue Service client
It will start WorkQueue RESTService
Server DB sets from environment variable.
Client DB sets from environment variable.
This checks whether DS call makes without error and return the results.
Not the correctness of functions. That will be tested in different module.
"""
def initialize(self):
self.config = DefaultConfig(
'WMCore.HTTPFrontEnd.WMBS.WMBSRESTModel')
dbUrl = os.environ.get("DATABASE", None)
self.config.setDBUrl(dbUrl)
# mysql example
#self.config.setDBUrl('mysql://[email protected]:3306/TestDB')
#self.config.setDBSocket('/var/lib/mysql/mysql.sock')
self.schemaModules = ["WMCore.WMBS", "WMCore.ResourceControl", "BossAir"]
def setUp(self):
"""
setUP global values
"""
RESTBaseUnitTest.setUp(self)
self.params = {}
self.params['endpoint'] = self.config.getServerUrl()
def tearDown(self):
RESTBaseUnitTest.tearDown(self)
def testWorkQueueService(self):
# test getWork
wmbsApi = WMBS(self.params)
self.assertEqual(wmbsApi.getResourceInfo(), [])
self.assertEqual(wmbsApi.getResourceInfo(tableFormat = False), {})