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


Python NsmUtil.getMetaProperties方法代码示例

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


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

示例1: run

# 需要导入模块: from isp.nsmUtil import NsmUtil [as 别名]
# 或者: from isp.nsmUtil.NsmUtil import getMetaProperties [as 别名]

#.........这里部分代码省略.........
                            
                        self.addUid([thisObject.uid, finalSubClassName, thisObject.createName])
                        self._dataStore[className][name]['detail'] = detail
                        
                        if className == 'IpReservation' or className == 'IpAddressPool':
                            thisObject.getAllocated(testCaseId)
                            thisObject.getAvailable(testCaseId)
                            thisObject.getReservations(testCaseId)
                        
                    elif action == 'catalog':
                        if online: thisObject.setOnLine()
                        elif not online: thisObject.setOffLine()
                        
                        catalog = thisObject.getCatalog(testCaseId)
                        name = thisObject.createName
                        result = NsmUtil.printResult(catalog, category)
                        self._resultList.append([className, name, action, category, str(testCaseId), str(result)])
                        self._dataStore[className][name]['catalog'] = catalog
                        
                    elif action == 'update' and Define._Update:

                        if online: thisObject.setOnLine()
                        elif not online: thisObject.setOffLine()
                        
                        NsmUtil.printHeadLine2('Test update is being called')
                        updateIndex = 1
                        storage = {}
                        metaPropertiesLines = None
                        ### for csv file defined in test case json file
                        if 'test.case.file' in testCase.keys():
                            metaPropertyTestCaseFileName = testCase['test.case.file']
                            if not metaPropertyTestCaseFileName in self._metaPropertyTestCases.keys():
                                testCaseFilePath = Define._PathReqeustBodyUpdate + '/' + testCase['test.case.file']
                                metaProperties = NsmUtil.getMetaProperties(testCaseFilePath)
                                self._metaPropertyTestCases[metaPropertyTestCaseFileName] = metaProperties
                            self._logger.debug('className: ' + className + '; name: ' + name)     
                            metaPropertiesLines = self._metaPropertyTestCases[metaPropertyTestCaseFileName][className][name]        
                            
                            requestBody = None
                            
                            storage['_uidList'] = self._uidList
                            storage['_internetEdgeZoneLayer3VlanReservedIpAddressList'] = self._internetEdgeZoneLayer3VlanReservedIpAddressList
                            storage['_securedInternetEdgeZoneLayer3VlanReservedIpAddressList'] = self._securedInternetEdgeZoneLayer3VlanReservedIpAddressList

                            
                            if testCase['test.case.file'] == 'update-all-meta-properties.csv' or testCase['test.case.file'] == 'update-all-meta-properties-simplified.csv':
                                
                                if Define._UpdateSingleMetaProperties:
                                    NsmUtil.printHeadLine2(className + ' [' + name + '] - ' + action + ' description - ' + category + ' - test case ' + str(testCaseId) + '-' + str(updateIndex))
                                    updateDescription = 'This is the update description of my ' + name
                                    requestBody, updateVerificationPatternList = NsmUtil.createRequestBodyProperty(className, thisObject.createName, updateDescription)
                                    result = self.testUpdate(className, requestBody, category, testCaseId, updateIndex)
                                    updateIndex += 1
                                    self._totalTestCase += 1
                                    result = NsmUtil.printResult(result, category)
                                    self._resultList.append([className, name, action, category, str(testCaseId)+'-'+str(updateIndex), str(result)])
                                    
                                    ### can't udpate pod name at this moment
                                    if className != 'Pod':
                                        NsmUtil.printHeadLine2(className + ' [' + name + '] - ' + action + ' name - ' + category + ' - test case ' + str(testCaseId) + '-' + str(updateIndex))
                                        updateName = 'My Default Update ' + name 
                                        requestBody, updateVerificationPatternList = NsmUtil.createRequestBodyProperty(className, updateName)
                                        result = self.testUpdate(className, requestBody, category, testCaseId, updateIndex)
                                        updateIndex += 1
                                        self._totalTestCase += 1
                                        result = NsmUtil.printResult(result, category)
开发者ID:huhe56,项目名称:nsm-rest-api,代码行数:70,代码来源:test.py

示例2: run

# 需要导入模块: from isp.nsmUtil import NsmUtil [as 别名]
# 或者: from isp.nsmUtil.NsmUtil import getMetaProperties [as 别名]

#.........这里部分代码省略.........
                     
                 elif action == 'detail':
                     if online: thisObject.setOnLine()
                     elif not online: thisObject.setOffLine()
                     
                     detail = thisObject.getDetail(testCaseId)
                     name = thisObject.createName
                     result = NsmUtil.printResult(detail, category)
                     self._resultList.append([className, name, action, category, str(testCaseId), str(result)])
                     
                     self.addUid([thisObject.uid, thisObject.mySubClassName, thisObject.createName])
                     self._dataStore[className][name]['detail'] = detail
                     
                     if className == 'IpReservation' or className == 'IpAddressPool':
                         thisObject.getAllocated(testCaseId)
                         thisObject.getAvailable(testCaseId)
                         thisObject.getReservations(testCaseId)
                     
                 elif action == 'catalog':
                     if online: thisObject.setOnLine()
                     elif not online: thisObject.setOffLine()
                     
                     catalog = thisObject.getCatalog(testCaseId)
                     name = thisObject.createName
                     result = NsmUtil.printResult(catalog, category)
                     self._resultList.append([className, name, action, category, str(testCaseId), str(result)])
                     self._dataStore[className][name]['catalog'] = catalog
                     
                 elif action == 'update' and online and Define._Update:
                     if 'test.case.file' in testCase.keys():
                         metaPropertyTestCaseFileName = testCase['test.case.file']
                         if not metaPropertyTestCaseFileName in self._metaPropertyTestCases.keys():
                             testCaseFilePath = Define._PathTestCase + '/' + testCase['test.case.file']
                             metaProperties = NsmUtil.getMetaProperties(testCaseFilePath)
                             self._metaPropertyTestCases[metaPropertyTestCaseFileName] = metaProperties
                         self._logger.debug('className: ' + className + '; name: ' + name)
                         metaPropertiesLines = self._metaPropertyTestCases[metaPropertyTestCaseFileName][className][name]
                         
                         requestBody = None
                         if testCase['test.case.file'] == 'update-all-meta-properties.csv':
                             self._totalTestCase += 1
                             NsmUtil.printHeadLine2(className + ' [' + name + '] - ' + action + ' description - ' + category + ' - test case ' + str(testCaseId) + '-' + str(self._totalTestCase))
                             updateDescription = 'This is the default update description of my ' + className
                             requestBody = NsmUtil.createRequestBodyProperty(className, thisObject.createName, updateDescription)
                             result = self.testUpdate(className, requestBody, category, testCaseId)
                             result = NsmUtil.printResult(result, category)
                             self._resultList.append([className, name, action, category, str(testCaseId)+'-'+str(self._totalTestCase), str(result)])
                             
                             ### can't udpate pod name at this moment
                             if className != 'Pod':
                                 self._totalTestCase += 1
                                 NsmUtil.printHeadLine2(className + ' [' + name + '] - ' + action + ' name - ' + category + ' - test case ' + str(testCaseId) + '-' + str(self._totalTestCase))
                                 updateName = 'My Default Update ' + className
                                 requestBody = NsmUtil.createRequestBodyProperty(className, updateName)
                                 result = self.testUpdate(className, requestBody, category, testCaseId)
                                 result = NsmUtil.printResult(result, category)
                                 self._resultList.append([className, name, action, category, str(testCaseId)+'-'+str(self._totalTestCase), str(result)])
                             
                         for oneMetaProperties in metaPropertiesLines:
                             self._totalTestCase += 1
                             NsmUtil.printHeadLine2(className + ' [' + name + '] - ' + action + ' - ' + category + ' - test case ' + str(testCaseId) + '-' + str(self._totalTestCase))
                             
                             storage = {}
                             storage['_uidList'] = self._uidList
                             storage['_internetEdgeZoneLayer3VlanReservedIpAddressList'] = self._internetEdgeZoneLayer3VlanReservedIpAddressList
                             storage['_securedInternetEdgeZoneLayer3VlanReservedIpAddressList'] = self._securedInternetEdgeZoneLayer3VlanReservedIpAddressList
开发者ID:huhe56,项目名称:nsm-rest-api,代码行数:70,代码来源:test-all-old.py


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