本文整理汇总了Python中WMCore_t.RequestManager_t.ReqMgr_t.RequestManagerConfig.section_方法的典型用法代码示例。如果您正苦于以下问题:Python RequestManagerConfig.section_方法的具体用法?Python RequestManagerConfig.section_怎么用?Python RequestManagerConfig.section_使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore_t.RequestManager_t.ReqMgr_t.RequestManagerConfig
的用法示例。
在下文中一共展示了RequestManagerConfig.section_方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AdminTest
# 需要导入模块: from WMCore_t.RequestManager_t.ReqMgr_t import RequestManagerConfig [as 别名]
# 或者: from WMCore_t.RequestManager_t.ReqMgr_t.RequestManagerConfig import section_ [as 别名]
class AdminTest(RESTBaseUnitTest):
"""
_AdminTest_
Test for the lower-level DB code in the admin section
"""
def setUp(self):
"""
setUP global values
Database setUp is done in base class
"""
self.couchDBName = "reqmgr_t_0"
RESTBaseUnitTest.setUp(self)
self.testInit.setupCouch("%s" % self.couchDBName,
"GroupUser", "ConfigCache")
reqMgrHost = self.config.getServerUrl()
self.jsonSender = JSONRequests(reqMgrHost)
return
def initialize(self):
self.config = RequestManagerConfig(
'WMCore.HTTPFrontEnd.RequestManager.ReqMgrRESTModel')
self.config.setFormatter('WMCore.WebTools.RESTFormatter')
self.config.setupRequestConfig()
self.config.setupCouchDatabase(dbName = self.couchDBName)
self.config.setPort(12888)
self.schemaModules = ["WMCore.RequestManager.RequestDB"]
return
def tearDown(self):
"""
_tearDown_
Basic tear down of database
"""
RESTBaseUnitTest.tearDown(self)
self.testInit.tearDownCouch()
return
def testA_SoftwareManagement(self):
"""
_SoftwareManagement_
Test the SoftwareManagement code
"""
self.assertEqual(SoftwareManagement.listSoftware(), {})
softwareVersions = ReqMgrWebTools.allScramArchsAndVersions()
ReqMgrWebTools.updateScramArchsAndCMSSWVersions()
result = SoftwareManagement.listSoftware()
for scramArch in result.keys():
self.assertEqual(set(result[scramArch]), set(softwareVersions[scramArch]))
# Now for each scramArch insert a blank set
# Because of the way that updateSoftware works, this interprets a blank list
# as telling it that no softwareVersions are available.
# It deletes every software version it is not handed, so it should give nothing out.
for scramArch in result.keys():
SoftwareManagement.updateSoftware(softwareNames = [], scramArch = scramArch)
self.assertEqual(SoftwareManagement.listSoftware(), {})
from WMCore.HTTPFrontEnd.RequestManager import Admin
setattr(self.config, 'database', self.testInit.coreConfig.CoreDatabase)
self.config.section_('templates')
self.config.section_('html')
admin = Admin.Admin(self.config)
ReqMgrWebTools.updateScramArchsAndCMSSWVersions()
self.assertTrue('slc5_amd64_gcc434' in admin.scramArchs())
return