本文整理汇总了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), {})