本文整理汇总了Python中WMCore.Services.EmulatorSwitch.EmulatorHelper类的典型用法代码示例。如果您正苦于以下问题:Python EmulatorHelper类的具体用法?Python EmulatorHelper怎么用?Python EmulatorHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EmulatorHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
def tearDown(self):
"""
_tearDown_
"""
super(SiteDBTest, self).tearDown()
EmulatorHelper.resetEmulators()
return
示例2: testEmulator
def testEmulator(self):
EmulatorHelper.setEmulators(True, True, True, True)
self.assertEqual(PhEDEx().wrapped.__module__,
'WMQuality.Emulators.PhEDExClient.PhEDEx')
self.assertEqual(DBSReader(self.globalDBS).wrapped.__module__,
'WMQuality.Emulators.DBSClient.DBSReader')
self.assertEqual(SiteDBJSON().wrapped.__module__,
'WMQuality.Emulators.SiteDBClient.SiteDB')
self.assertEqual(RequestManager().wrapped.__module__,
'WMQuality.Emulators.RequestManagerClient.RequestManager')
self.assertEqual(PhEDEx().__class__.__name__, 'PhEDEx')
self.assertEqual(DBSReader(self.globalDBS).__class__.__name__, 'DBSReader')
self.assertEqual(SiteDBJSON().__class__.__name__, 'SiteDBJSON')
self.assertEqual(RequestManager().__class__.__name__, 'RequestManager')
EmulatorHelper.resetEmulators()
self.assertEqual(PhEDEx().wrapped.__module__,
'WMCore.Services.PhEDEx.PhEDEx')
self.assertEqual(DBSReader(self.globalDBS).wrapped.__module__,
'WMCore.Services.DBS.DBS2Reader')
self.assertEqual(SiteDBJSON().wrapped.__module__,
'WMCore.Services.SiteDB.SiteDB')
self.assertEqual(RequestManager().wrapped.__module__,
'WMCore.Services.RequestManager.RequestManager')
self.assertEqual(PhEDEx().__class__.__name__, 'PhEDEx')
self.assertEqual(DBSReader(self.globalDBS).__class__.__name__, 'DBS2Reader')
self.assertEqual(SiteDBJSON().__class__.__name__, 'SiteDBJSON')
self.assertEqual(RequestManager().__class__.__name__, 'RequestManager')
示例3: setUp
def setUp(self):
"""
_setUp_
Setup couchdb and the test environment
"""
# Set external test helpers
self.testInit = TestInitCouchApp(__file__)
self.testInit.setLogging()
self.testInit.setupCouch("resubmitblock_t", "ACDC", "GroupUser")
EmulatorHelper.setEmulators(siteDB = True)
# Define test environment
self.couchUrl = os.environ["COUCHURL"]
self.acdcDBName = 'resubmitblock_t'
self.validLocations = ['srm-cms.gridpp.rl.ac.uk', 'cmssrm.fnal.gov', 'srm.unl.edu']
self.validLocationsCMSNames = ['T2_US_Nebraska', 'T1_US_FNAL', 'T1_UK_RAL']
self.siteWhitelist = ['T2_XX_SiteA']
self.workflowName = 'dballest_ReReco_workflow'
couchServer = CouchServer(dburl = self.couchUrl)
self.acdcDB = couchServer.connectDatabase(self.acdcDBName, create = False)
user = makeUser('unknown', '[email protected]', self.couchUrl, self.acdcDBName)
user.create()
return
示例4: setUp
def setUp(self):
WorkQueueTestCase.setUp(self)
EmulatorHelper.setEmulators(phedex = True, dbs = True,
siteDB = True, requestMgr = False)
self.globalQCouchUrl = "%s/%s" % (self.testInit.couchUrl, self.globalQDB)
self.localQCouchUrl = "%s/%s" % (self.testInit.couchUrl,
self.localQInboxDB)
示例5: setUp
def setUp(self):
"""
_setUp_
Install schema and create a DAO factory for WMBS.
"""
EmulatorHelper.setEmulators(phedex = False, dbs = False,
siteDB = True, requestMgr = False)
self.testInit = TestInit(__file__)
self.testInit.setLogging()
self.testInit.setDatabaseConnection()
self.testInit.setSchema(customModules = ["WMCore.WMBS",
"WMCore.ResourceControl",
"WMCore.BossAir"],
useDefault = False)
myThread = threading.currentThread()
self.daoFactory = DAOFactory(package="WMCore.WMBS",
logger = myThread.logger,
dbinterface = myThread.dbi)
self.baDaoFactory = DAOFactory(package = "WMCore.BossAir",
logger = myThread.logger,
dbinterface = myThread.dbi)
self.insertRunJob = self.baDaoFactory(classname = "NewJobs")
self.insertState = self.baDaoFactory(classname = "NewState")
states = ['PEND', 'RUN', 'Idle', 'Running']
self.insertState.execute(states)
self.tempDir = self.testInit.generateWorkDir()
return
示例6: setUp
def setUp(self):
"""
_setUp_
Setup couchdb and the test environment
"""
super(ResubmitBlockTest, self).setUp()
self.group = 'unknown'
self.user = 'unknown'
# Set external test helpers
self.testInit = TestInitCouchApp(__file__)
self.testInit.setLogging()
self.testInit.setupCouch("resubmitblock_t", "ACDC", "GroupUser")
EmulatorHelper.setEmulators(phedex=False, dbs=False, siteDB=True, requestMgr=False)
# Define test environment
self.couchUrl = os.environ["COUCHURL"]
self.acdcDBName = 'resubmitblock_t'
self.validLocations = ['T2_US_Nebraska', 'T1_US_FNAL', 'T1_UK_RAL']
self.siteWhitelist = ['T2_XX_SiteA']
self.workflowName = 'dballest_ReReco_workflow'
couchServer = CouchServer(dburl=self.couchUrl)
self.acdcDB = couchServer.connectDatabase(self.acdcDBName, create=False)
user = makeUser(self.group, '[email protected]', self.couchUrl, self.acdcDBName)
user.create()
return
示例7: setUp
def setUp(self):
"""
_setUp_
Install the DBSBuffer schema into the database and connect to PhEDEx.
"""
self.phedexURL = "https://bogus.cern.ch/bogus"
self.dbsURL = "https://bogus.cern.ch/bogus"
EmulatorHelper.setEmulators(phedex = True, dbs = True, siteDB = True)
self.testInit = TestInit(__file__)
self.testInit.setLogging()
self.testInit.setDatabaseConnection()
self.testInit.setSchema(customModules = ["WMComponent.DBS3Buffer",
"WMCore.WMBS"],
useDefault = False)
self.testFilesA = []
self.testFilesB = []
self.testDatasetA = "/BogusPrimary/Run2012Z-PromptReco-v1/RECO"
self.testDatasetB = "/BogusPrimary/CRUZET11-v1/RAW"
return
示例8: setUp
def setUp(self):
"""
Setup for unit tests
"""
super(SiteDBTest, self).setUp()
EmulatorHelper.setEmulators(phedex=False, dbs=False, siteDB=False, requestMgr=True)
self.mySiteDB = SiteDBJSON()
示例9: setUp
def setUp(self):
"""
setup for test.
"""
myThread = threading.currentThread()
self.testInit = TestInit(__file__)
self.testInit.setLogging()
self.testInit.setDatabaseConnection()
#self.tearDown()
self.testInit.setSchema(customModules = ["WMCore.WMBS"],
useDefault = False)
self.testInit.setupCouch("jobarchiver_t_0/jobs", "JobDump")
self.testInit.setupCouch("jobarchiver_t_0/fwjrs", "FWJRDump")
self.daofactory = DAOFactory(package = "WMCore.WMBS",
logger = myThread.logger,
dbinterface = myThread.dbi)
self.getJobs = self.daofactory(classname = "Jobs.GetAllJobs")
self.testDir = self.testInit.generateWorkDir(deleteOnDestruction = False)
self.nJobs = 10
EmulatorHelper.setEmulators(phedex = True, dbs = True,
siteDB = True, requestMgr = False)
self.configFile = EmulatorSetup.setupWMAgentConfig()
return
示例10: tearDown
def tearDown(self):
"""
_tearDown_
Delete the database.
"""
self.testInit.clearDatabase()
EmulatorHelper.resetEmulators()
示例11: tearDown
def tearDown(self):
"""tearDown"""
WorkQueueTestCase.tearDown(self)
try:
self.specGenerator.removeSpecs()
except:
pass
EmulatorHelper.resetEmulators()
示例12: tearDown
def tearDown(self):
"""
Clear out the database.
"""
self.testInit.tearDownCouch()
self.testInit.clearDatabase()
self.testInit.delWorkDir()
EmulatorHelper.resetEmulators()
示例13: tearDown
def tearDown(self):
"""
_tearDown_
Drop all the WMBS tables.
"""
self.testInit.tearDownCouch()
EmulatorHelper.resetEmulators()
self.specGenerator.removeSpecs()
示例14: tearDown
def tearDown(self):
"""
_tearDown_
Clean couchdb and test environment
"""
self.testInit.tearDownCouch()
EmulatorHelper.resetEmulators()
return
示例15: tearDown
def tearDown(self):
"""
_tearDown_
Delete the database.
"""
self.testInit.clearDatabase()
EmulatorHelper.resetEmulators()
super(PhEDExInjectorSubscriberTest, self).tearDown()