本文整理汇总了Python中WMCore.Cache.WMConfigCache.ConfigCache.attachments['configFile']方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigCache.attachments['configFile']方法的具体用法?Python ConfigCache.attachments['configFile']怎么用?Python ConfigCache.attachments['configFile']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore.Cache.WMConfigCache.ConfigCache
的用法示例。
在下文中一共展示了ConfigCache.attachments['configFile']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getConfig
# 需要导入模块: from WMCore.Cache.WMConfigCache import ConfigCache [as 别名]
# 或者: from WMCore.Cache.WMConfigCache.ConfigCache import attachments['configFile'] [as 别名]
def getConfig(self):
"""
_getConfig_
Create a test config and put it in the cache
"""
PSetTweak = {'someKey': "Hello, I am a PSetTweak. It's nice to meet you."}
configCache = ConfigCache(os.environ["COUCHURL"], couchDBName = 'config_test')
configCache.createUserGroup(groupname = "testGroup", username = 'testOps')
configCache.setPSetTweaks(PSetTweak = PSetTweak)
configCache.attachments['configFile'] = 'This Is A Test Config'
configCache.save()
return configCache
示例2: testE_SaveConfigFileToDisk
# 需要导入模块: from WMCore.Cache.WMConfigCache import ConfigCache [as 别名]
# 或者: from WMCore.Cache.WMConfigCache.ConfigCache import attachments['configFile'] [as 别名]
def testE_SaveConfigFileToDisk(self):
"""
_SaveConfigFileToDisk_
Check and see if we can save the config file attachment to disk
"""
targetFile = os.path.join(self.testDir, 'configCache.test')
configCache = ConfigCache(os.environ["COUCHURL"], couchDBName = 'config_test')
configCache.createUserGroup(groupname = "testGroup", username = 'testOps')
configCache.attachments['configFile'] = 'ThisIsAConfigFile'
configCache.saveConfigToDisk(targetFile = targetFile)
f = open(targetFile, 'r')
content = f.read()
f.close()
self.assertEqual(content, configCache.getConfig())
return