当前位置: 首页>>代码示例>>Python>>正文


Python EmulatorHelper.setEmulators方法代码示例

本文整理汇总了Python中WMCore.Services.EmulatorSwitch.EmulatorHelper.setEmulators方法的典型用法代码示例。如果您正苦于以下问题:Python EmulatorHelper.setEmulators方法的具体用法?Python EmulatorHelper.setEmulators怎么用?Python EmulatorHelper.setEmulators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WMCore.Services.EmulatorSwitch.EmulatorHelper的用法示例。


在下文中一共展示了EmulatorHelper.setEmulators方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testEmulator

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    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')
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:33,代码来源:EmulatorSetup_t.py

示例2: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    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
开发者ID:AndresTanasijczuk,项目名称:WMCore,代码行数:32,代码来源:JobArchiver_t.py

示例3: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
 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)
开发者ID:stuartw,项目名称:WMCore,代码行数:9,代码来源:WorkQueueReqMgrInterface_t.py

示例4: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    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
开发者ID:cinquo,项目名称:WMCore,代码行数:35,代码来源:ResourceControl_t.py

示例5: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    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
开发者ID:elasticaso,项目名称:WMCore,代码行数:27,代码来源:ResubmitBlock_t.py

示例6: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    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
开发者ID:huohuo21,项目名称:WMCore,代码行数:31,代码来源:ResubmitBlock_t.py

示例7: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
 def setUp(self):
     """
     Setup for unit tests
     """
     super(SiteDBTest, self).setUp()
     EmulatorHelper.setEmulators(phedex=False, dbs=False, siteDB=False, requestMgr=True)
     self.mySiteDB = SiteDBJSON()
开发者ID:huohuo21,项目名称:WMCore,代码行数:9,代码来源:SiteDB_t.py

示例8: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    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
开发者ID:cinquo,项目名称:WMCore,代码行数:27,代码来源:PhEDExInjectorSubscriber_t.py

示例9: testGetEmulators

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
 def testGetEmulators(self):
     from WMCore.Services.PhEDEx.PhEDEx import PhEDEx
     phedexJSON = PhEDEx(responseType='json')
     self.assertTrue( hasattr( phedexJSON, '_testNonExistentInEmulator' ) )
     EmulatorHelper.setEmulators(phedex = True, dbs = True, 
                                 siteDB = True, requestMgr = False)
     phedexJSON2 = PhEDEx(responseType='json')
     self.assertFalse( hasattr( phedexJSON2, '_testNonExistentInEmulator' ) )
     EmulatorHelper.resetEmulators()
     phedexJSON2 = PhEDEx(responseType='json')
     self.assertTrue( hasattr( phedexJSON2, '_testNonExistentInEmulator' ) )
开发者ID:stuartw,项目名称:WMCore,代码行数:13,代码来源:EmulatorSwitch_t.py

示例10: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    def setUp(self):
        """
        If we dont have a wmspec file create one
        """

        EmulatorHelper.setEmulators(phedex=False, dbs=False, siteDB=True, requestMgr=True)
        WorkQueueTestCase.setUp(self)

        self.cacheDir = tempfile.mkdtemp()
        self.specGenerator = WMSpecGenerator(self.cacheDir)
        self.specs = self.createReRecoSpec(1, "file")

        # Create queues
        self.localQueue = localQueue(DbName=self.queueDB, InboxDbName=self.queueInboxDB, \
                NegotiationTimeout=0, QueueURL='global.example.com', CacheDir=self.cacheDir, central_logdb_url="%s/%s" %(self.couchURL, self.logDBName), log_reporter='lq_profile_test')
开发者ID:huohuo21,项目名称:WMCore,代码行数:17,代码来源:LocalQueueProfile_t.py

示例11: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    def setUp(self):
        """
        Initialize the database and couch.

        """
        self.testInit = TestInitCouchApp(__file__)
        self.testInit.setLogging()
        self.testInit.setDatabaseConnection()
        self.testInit.setupCouch("pileupfetcher_t", "ConfigCache")
        self.testInit.setSchema(customModules = ["WMCore.WMBS"],
                                useDefault = False)
        couchServer = CouchServer(os.environ["COUCHURL"])
        self.configDatabase = couchServer.connectDatabase("pileupfetcher_t")
        self.testDir = self.testInit.generateWorkDir()
        EmulatorHelper.setEmulators(dbs = True)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:17,代码来源:PileupFetcher_t.py

示例12: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    def setUp(self):
        """
        If we dont have a wmspec file create one

        Warning: For the real profiling test including
        spec generation. need to use real spec instead of
        using emulator generated spec which doesn't include
        couchDB access and cmssw access
        """
        EmulatorHelper.setEmulators(phedex=True, dbs=True, siteDB=True, requestMgr=True)
        WorkQueueTestCase.setUp(self)

        self.cacheDir = tempfile.mkdtemp()
        self.specGenerator = WMSpecGenerator(self.cacheDir)
        self.specNamePrefix = "TestReReco_"
        self.specs = self.createReRecoSpec(5, "file")
        # Create queues
        self.globalQueue = globalQueue(DbName=self.globalQDB, InboxDbName=self.globalQInboxDB, NegotiationTimeout=0)
开发者ID:dciangot,项目名称:WMCore,代码行数:20,代码来源:WorkQueueProfile_t.py

示例13: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    def setUp(self):
        """
        If we dont have a wmspec file create one
        """

        EmulatorHelper.setEmulators(phedex = True, dbs = True,
                                    siteDB = True, requestMgr = True)
        WorkQueueTestCase.setUp(self)

        self.cacheDir = tempfile.mkdtemp()
        self.specGenerator = WMSpecGenerator(self.cacheDir)
        self.specs = self.createReRecoSpec(1, "file")

        # Create queues
        self.localQueue = localQueue(DbName = self.queueDB,
                                     InboxDbName = self.queueInboxDB,
                                     NegotiationTimeout = 0,
                                     QueueURL = 'global.example.com',
                                     CacheDir = self.cacheDir)
开发者ID:ticoann,项目名称:WMCore,代码行数:21,代码来源:LocalQueueProfile_t.py

示例14: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    def setUp(self):
        """
        _setUp_
        """
        EmulatorHelper.setEmulators(phedex = True, dbs = True, 
                                    siteDB = True, requestMgr = True)

        self.specGenerator = WMSpecGenerator("WMSpecs")
        #self.configFile = EmulatorSetup.setupWMAgentConfig()
        self.schema = []
        self.couchApps = ["WorkQueue"]
        self.testInit = TestInitCouchApp('WorkQueueServiceTest')
        self.testInit.setLogging()
        self.testInit.setDatabaseConnection()
        self.testInit.setSchema(customModules = self.schema,
                                useDefault = False)
        self.testInit.setupCouch('workqueue_t', *self.couchApps)
        self.testInit.setupCouch('workqueue_t_inbox', *self.couchApps)
        return
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:21,代码来源:WorkQueue_t.py

示例15: setUp

# 需要导入模块: from WMCore.Services.EmulatorSwitch import EmulatorHelper [as 别名]
# 或者: from WMCore.Services.EmulatorSwitch.EmulatorHelper import setEmulators [as 别名]
    def setUp(self):
        """
        _setUp_

        Set up test environment
        """
        self.testInit = TestInit(__file__)
        self.testInit.setLogging()
        self.testInit.setDatabaseConnection()
        self.testInit.setSchema(customModules = ["WMCore.WMBS",
                                                 "WMCore.BossAir"],
                                useDefault = False)
        self.testInit.setupCouch('workqueue_t', 'WorkQueue')
        self.testInit.setupCouch('workqueue_inbox_t', 'WorkQueue')
        self.testDir = self.testInit.generateWorkDir(deleteOnDestruction = False)
        EmulatorHelper.setEmulators(phedex = True, dbs = True,
                                    siteDB = True, requestMgr = True)

        myThread = threading.currentThread()
        self.daoFactory = DAOFactory(package = "WMCore.WMBS",
                                     logger = logging,
                                     dbinterface = myThread.dbi)
        self.listWorkflows = self.daoFactory(classname = "Workflow.ListForSubmitter")
开发者ID:cinquo,项目名称:WMCore,代码行数:25,代码来源:JobUpdater_t.py


注:本文中的WMCore.Services.EmulatorSwitch.EmulatorHelper.setEmulators方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。