當前位置: 首頁>>代碼示例>>Python>>正文


Python NsmUtil.createRequestBodyProperty方法代碼示例

本文整理匯總了Python中isp.nsmUtil.NsmUtil.createRequestBodyProperty方法的典型用法代碼示例。如果您正苦於以下問題:Python NsmUtil.createRequestBodyProperty方法的具體用法?Python NsmUtil.createRequestBodyProperty怎麽用?Python NsmUtil.createRequestBodyProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在isp.nsmUtil.NsmUtil的用法示例。


在下文中一共展示了NsmUtil.createRequestBodyProperty方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run

# 需要導入模塊: from isp.nsmUtil import NsmUtil [as 別名]
# 或者: from isp.nsmUtil.NsmUtil import createRequestBodyProperty [as 別名]

#.........這裏部分代碼省略.........
                        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)
                                        self._resultList.append([className, name, action, category, str(testCaseId)+'-'+str(updateIndex), str(result)])
                                    
                                    for oneMetaProperties in metaPropertiesLines:
                                        NsmUtil.printHeadLine2(className + ' [' + name + '] - ' + action + ' - ' + category + ' - test case ' + str(testCaseId) + '-' + str(updateIndex))
                                        metaPropertiesWrapperList = []
                                        metaPropertiesWrapperList.append(oneMetaProperties)
                                        requestBody, updateVerificationPatternList = NsmUtil.createRequestBodyProperty(className, thisObject.createName, None, metaPropertiesWrapperList, storage)
                                        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)])
                                                                        
                                        result = self.testUpdateVerification(result, thisObject, pod, updateVerificationPatternList, className, name, category, testCaseId, storage)
                                    
                                # all meta properties
                                if Define._UpdateAllMetaProperties:
開發者ID:huhe56,項目名稱:nsm-rest-api,代碼行數:70,代碼來源:test.py

示例2: run

# 需要導入模塊: from isp.nsmUtil import NsmUtil [as 別名]
# 或者: from isp.nsmUtil.NsmUtil import createRequestBodyProperty [as 別名]

#.........這裏部分代碼省略.........
                     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
                             
                             metaPropertiesWrapperList = []
                             metaPropertiesWrapperList.append(oneMetaProperties)
                             requestBody = NsmUtil.createRequestBodyProperty(className, thisObject.createName, None, metaPropertiesWrapperList, storage)
                             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)])
                         
                         # all meta properties
                         if Define._UpdateAllMetaProperties:
開發者ID:huhe56,項目名稱:nsm-rest-api,代碼行數:70,代碼來源:test-all-old.py


注:本文中的isp.nsmUtil.NsmUtil.createRequestBodyProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。