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


Python RESTBaseUnitTest.setUp方法代码示例

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


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

示例1: setUp

# 需要导入模块: from WMQuality.WebTools.RESTBaseUnitTest import RESTBaseUnitTest [as 别名]
# 或者: from WMQuality.WebTools.RESTBaseUnitTest.RESTBaseUnitTest import setUp [as 别名]
 def setUp(self):
     RESTBaseUnitTest.setUp(self)
     self.testInit.setupCouch("%s" % self.couchDBName,
                              "GroupUser", "ConfigCache")
     self.params = {}
     self.params['endpoint'] = self.config.getServerUrl()
     self.reqService = RequestManagerDS(self.params)
     self.jsonSender = JSONRequests(self.config.getServerUrl())
     self.jsonSender.put('user/[email protected]')
     self.jsonSender.put('group/PeopleLikeMe')
     self.jsonSender.put('group/PeopleLikeMe/me')
     self.jsonSender.put('version/CMSSW_3_5_8/slc5_ia32_gcc434')
     
     schema = ReReco.getTestArguments()
     schema['RequestName'] = 'TestReReco'
     schema['RequestType'] = 'ReReco'
     schema['CmsPath'] = "/uscmst1/prod/sw/cms"
     schema['Requestor'] = '%s' % "me"
     schema['Group'] = '%s' % "PeopleLikeMe"
     schema['BlockWhitelist'] = ['/dataset/dataset/dataset#alpha']
     schema['BlockBlacklist'] = ['/dataset/dataset/dataset#beta']
     schema['Campaign'] = 'MyTestCampaign'        
     try:
         r = self.jsonSender.put('request/' + schema['RequestName'], schema)                             
     except Exception, ex:
         print "Exception during set up, investigate exception instance attributes:"
         print dir(ex)
         return
开发者ID:stuartw,项目名称:WMCore,代码行数:30,代码来源:RequestManager_t.py

示例2: setUp

# 需要导入模块: from WMQuality.WebTools.RESTBaseUnitTest import RESTBaseUnitTest [as 别名]
# 或者: from WMQuality.WebTools.RESTBaseUnitTest.RESTBaseUnitTest import setUp [as 别名]
    def setUp(self):
        RESTBaseUnitTest.setUp(self)
        self.testInit.setupCouch("%s" % self.couchDBName, "GroupUser", "ConfigCache", "ReqMgr")
        self.testInit.setupCouch("%s_wmstats" % self.couchDBName, "WMStats")
        # logging stuff from TestInit is broken, setting myself
        l = logging.getLogger()
        l.setLevel(logging.DEBUG)
        self.params = {}
        self.params['endpoint'] = self.config.getServerUrl()
        self.reqService = RequestManagerDS(self.params)
        self.jsonSender = JSONRequests(self.config.getServerUrl())

        userName     = 'Taizong'
        groupName    = 'Li'
        teamName     = 'Tang'
        schema = utils.getAndSetupSchema(self,
                                         userName = userName,
                                         groupName = groupName,
                                         teamName = teamName)
        schema['ConfigCacheID'] = self.createConfig()
        schema['CouchDBName'] = self.couchDBName
        schema['CouchWorkloadDBName'] = self.couchDBName

        try:
            r = self.jsonSender.put('request', schema)
            try:
                self.requestName = r[0]['RequestName']
            except:
                self.requestName = r[0].values()[0]['RequestName']
        except Exception as ex:
            msg = traceback.format_exc()
            print("Exception during set up, reason: %s" % msg)
            raise ex
开发者ID:BrunoCoimbra,项目名称:WMCore,代码行数:35,代码来源:RequestManager_t.py

示例3: setUp

# 需要导入模块: from WMQuality.WebTools.RESTBaseUnitTest import RESTBaseUnitTest [as 别名]
# 或者: from WMQuality.WebTools.RESTBaseUnitTest.RESTBaseUnitTest import setUp [as 别名]
 def setUp(self):
     """
     setUP global values
     """
     RESTBaseUnitTest.setUp(self)
     self.params = {}
     self.params['endpoint'] = self.config.getServerUrl()
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:9,代码来源:WMBS_t.py

示例4: setUp

# 需要导入模块: from WMQuality.WebTools.RESTBaseUnitTest import RESTBaseUnitTest [as 别名]
# 或者: from WMQuality.WebTools.RESTBaseUnitTest.RESTBaseUnitTest import setUp [as 别名]
 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, "ConfigCache", "ReqMgr")
     reqMgrHost = self.config.getServerUrl()
     self.jsonSender = JSONRequests(reqMgrHost)
开发者ID:BrunoCoimbra,项目名称:WMCore,代码行数:13,代码来源:Admin_t.py

示例5: setUp

# 需要导入模块: from WMQuality.WebTools.RESTBaseUnitTest import RESTBaseUnitTest [as 别名]
# 或者: from WMQuality.WebTools.RESTBaseUnitTest.RESTBaseUnitTest import setUp [as 别名]
 def setUp(self):
     """
     setUP global values
     """
     RESTBaseUnitTest.setUp(self)
     self.params = {}
     self.params['endpoint'] = self.config.getServerUrl()
     self.reqService = RequestManagerDS(self.params)
     self.jsonSender = JSONRequests(self.config.getServerUrl())
     self.requestSchema = getRequestSchema()
     self.jsonSender.put('group/PeopleLikeMe')
     self.jsonSender.put('user/[email protected]')
     self.jsonSender.put('group/PeopleLikeMe/me')
     self.jsonSender.put('version/CMSSW_3_5_8')
     self.jsonSender.put('request/' + self.requestSchema['RequestName'], 
                         self.requestSchema)
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:18,代码来源:RequestManager_t.py

示例6: setUp

# 需要导入模块: from WMQuality.WebTools.RESTBaseUnitTest import RESTBaseUnitTest [as 别名]
# 或者: from WMQuality.WebTools.RESTBaseUnitTest.RESTBaseUnitTest import setUp [as 别名]
    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, "ConfigCache", "ReqMgr")
        self.testInit.setupCouch("%s_wmstats" % self.couchDBName,
                                 "WMStats")
        self.testInit.setupCouch("%s_acdc" % self.couchDBName,
                                 "ACDC", "GroupUser")
        reqMgrHost = self.config.getServerUrl()
        self.jsonSender = JSONRequests(reqMgrHost)

        self.params = {}
        self.params['endpoint'] = reqMgrHost
        self.reqService = RequestManager(self.params)
开发者ID:BrunoCoimbra,项目名称:WMCore,代码行数:20,代码来源:ReqMgr_t.py

示例7: setUp

# 需要导入模块: from WMQuality.WebTools.RESTBaseUnitTest import RESTBaseUnitTest [as 别名]
# 或者: from WMQuality.WebTools.RESTBaseUnitTest.RESTBaseUnitTest import setUp [as 别名]
    def setUp(self):
        """
        setUP global values
        """
        RESTBaseUnitTest.setUp(self)
        reqMgrHost = self.config.getServerUrl()
        self.requestSchema = getRequestSchema()
        print reqMgrHost
        self.jsonSender = JSONRequests(reqMgrHost)
        #self.requestTypes = ['ReReco', 'StoreResults', 'CmsGen', 'Reco']
        #self.requestTypes = ['ReReco', 'MonteCarlo']
        self.requestTypes = ['ReReco']

        if 'me' in self.jsonSender.get('user')[0]:
            self.jsonSender.delete('user/me')    
        self.assertFalse('me' in self.jsonSender.get('user')[0])
        self.assertEqual(self.jsonSender.put('user/[email protected]')[1], 200)
        self.assertTrue('me' in self.jsonSender.get('user')[0])

        if 'PeopleLikeMe' in self.jsonSender.get('group')[0]:
            self.jsonSender.delete('group/PeopleLikeMe')
        self.assertFalse('PeopleLikeMe' in self.jsonSender.get('group')[0])
        self.assertEqual(self.jsonSender.put('group/PeopleLikeMe')[1], 200)
        self.assertTrue( 'PeopleLikeMe' in self.jsonSender.get('group')[0])

        self.jsonSender.put('group/PeopleLikeMe/me')
        users = json.loads(self.jsonSender.get('group/PeopleLikeMe')[0])['users']
        self.assertTrue('me' in users)
        groups = json.loads(self.jsonSender.get('user/me')[0])['groups']
        self.assertTrue('PeopleLikeMe' in groups)
        groups2 = self.jsonSender.get('group?user=me')[0]
        self.assertTrue('PeopleLikeMe' in groups2)

        if 'White Sox' in self.jsonSender.get('team')[0]:
            self.jsonSender.delete(urllib.quote('team/White Sox'))
        self.assertFalse('White Sox' in self.jsonSender.get('team')[0])
        self.assertEqual(self.jsonSender.put(urllib.quote('team/White Sox'))[1], 200)
        self.assertTrue('White Sox' in self.jsonSender.get('team')[0])

        # some foreign key stuff to dealwith
        #self.assertFalse('CMSSW_X_Y_Z' in self.jsonSender.get('version')[0])
        self.assertTrue(self.jsonSender.put('version/CMSSW_3_5_8')[1] == 200)
        self.assertTrue('CMSSW_3_5_8' in self.jsonSender.get('version')[0])
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:45,代码来源:ReqMgr_t.py

示例8: setUp

# 需要导入模块: from WMQuality.WebTools.RESTBaseUnitTest import RESTBaseUnitTest [as 别名]
# 或者: from WMQuality.WebTools.RESTBaseUnitTest.RESTBaseUnitTest import setUp [as 别名]
    def setUp(self):
        RESTBaseUnitTest.setUp(self)
        self.testInit.setupCouch("%s" % self.couchDBName, "GroupUser", "ConfigCache")
        self.testInit.setupCouch("%s_wmstats" % self.couchDBName, "WMStats")
        # logging stuff from TestInit is broken, setting myself
        l = logging.getLogger()
        l.setLevel(logging.DEBUG)
        self.params = {}
        self.params['endpoint'] = self.config.getServerUrl()
        self.reqService = RequestManagerDS(self.params)
        self.jsonSender = JSONRequests(self.config.getServerUrl())

        userName     = 'Taizong'
        groupName    = 'Li'
        teamName     = 'Tang'
        schema = utils.getAndSetupSchema(self,
                                         userName = userName,
                                         groupName = groupName,
                                         teamName = teamName)                
        try:
            r = self.jsonSender.put('request/' + schema['RequestName'], schema)                             
        except Exception, ex:
            print "Exception during set up, reason: %s" % ex
            return
开发者ID:ticoann,项目名称:WMCore,代码行数:26,代码来源:RequestManager_t.py

示例9: setUp

# 需要导入模块: from WMQuality.WebTools.RESTBaseUnitTest import RESTBaseUnitTest [as 别名]
# 或者: from WMQuality.WebTools.RESTBaseUnitTest.RESTBaseUnitTest import setUp [as 别名]
 def setUp(self):
     """
     _setUp_
     """
     RESTBaseUnitTest.setUp(self)
开发者ID:AndresTanasijczuk,项目名称:CRABClient,代码行数:7,代码来源:FakeRESTServer.py


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