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


Python Log.debug方法代碼示例

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


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

示例1: doSheet

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def doSheet(self, excelAPP, sheetName):
     Log.debug('start: ExcelColumnFixture.doSheet')
     sheet = self.excelAPP.getShByName(sheetName)
     self.excelAPP.setSheet(sheet)
     ncols = sheet.ncols
     nrows = sheet.nrows
     try:
         fixturePath, rowpos = self.getFixturePath(0, ncols)
         if fixturePath == '':  # if have not fixture row, use default fixture
             print 'warning:'
             print 'no specify fixture path or fixture in the first row in excel'
             print 'automation will use default fixture, apifixture.TempleteFixture'
             Log.debug('automation use default fixture, apifixture.TempleteFixture')
             fixturePath = 'apifixture.TempleteFixture'
             #sys.exit(0)
             #fixturePath = 'apifixture.TempleteFixture'
         _CLASSNAME = fixturePath.split('.')[-1]
         i = fixturePath.split('$')
         if len(i) == 1:
             exec 'import ' + fixturePath
             # test class method
             exec 'fixture = ' + fixturePath + '.' + _CLASSNAME + '()' 
         else:
             exec "import %s" % (i[0],)
             exec "fixture = %s.%s()" % (i[0], i[1])
     except ImportError, e:
         Log.exception(e)
         print 'fixturePath does not exists'
         print 'system exit'
         return
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:32,代碼來源:ExcelColumnFixture.py

示例2: dosheets

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def dosheets(self, excelAPP, reportFileName):
     Log.debug('start: ExcelColumnFixture.dosheets')
     self.excelAPP = excelAPP
     self.reportFileName = reportFileName
     self.summary["run date"] = time.ctime(time.time())
     self.summary["run elapsed time"] = RunTime()
     sheets = self.excelAPP.getShNameList()
     self.reportNameList = []
     try:
         if not os.path.exists(REPORTPATH):
             os.mkdir(REPORTPATH)
         if not os.path.exists(FAILREPORTPATH):
             os.mkdir(FAILREPORTPATH)
     except:
         Log.error("create report fail")
     for sheetName in sheets:
         self.counts = Counts()
         if sheetName.lower().find("test") == -1:
             continue
         self.resetReportFileName(reportFileName, sheetName)
         self.reportNameList.append(self.reportFileName)
         #self.reportNameList.append(self.failReportFileName)
         print 'start test: ', sheetName
         try:
             self.doSheet(excelAPP, sheetName)
         except KeyboardInterrupt:
             sys.exit(0)
     self.makeSummaryReport()
     Log.debug('end: ExcelColumnFixture.dosheets')
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:31,代碼來源:ExcelColumnFixture.py

示例3: runTest

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def runTest(self):
     Log.debug('start: DcgFixture.runTest')
     print 'now start to test......'
     starttime = datetime.datetime.now()
     runTime = 0
     try:
         Log.info('iteration count: ' + str(GlobalSetting.ITERATION))
         iterationCount = GlobalSetting.ITERATION
         if type(iterationCount) != types.IntType:
             iterationCount = 0
         while True:       
             path = 'reports\\'
             if not os.path.exists(path):
                 os.mkdir(path)   
             dcg = TextFixture() 
             dcg.doTextTest(self.textfilename, path + self.outreportname)
             endtime = datetime.datetime.now()
             runTime = (endtime - starttime).seconds
             print 'run time(seconds) is: ' + str(runTime)
             try:
                 if GlobalSetting.RUNTIME > 0:
                     if runTime > GlobalSetting.RUNTIME:
                         break
                 elif iterationCount < 1:
                     break
             except BaseException, e:
                 Log.exception(e)
                 break              
             iterationCount -= 1
     except (KeyboardInterrupt, SystemExit), e:
             print 'user Interrupt test'
             Log.exception(e)
             os._exit(0)
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:35,代碼來源:TextRunner.py

示例4: savePreResultInfo

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
    def savePreResultInfo(self, resp):
        Log.debug('start savePreResultInfo: ' + self._CLASSNAME)
        try:
            Log.debug('start savePreResultInfo: ' + resp)
            respDict = strToDict(resp)
            Log.debug('respDict: ', respDict)
            Log.debug('needSavePreResults: ', self.needSavePreResults)
            if respDict and self.needSavePreResults.find('{') > -1:
                needSavePreResultDict = strToDict(self.needSavePreResults)
                if needSavePreResultDict:
                    Log.debug('needSavePreResultDict: ', needSavePreResultDict)
                    for key in needSavePreResultDict:
                        self.getValueFromResp(key, needSavePreResultDict[key], respDict)
                else:
                    print 'json或dictionary is error'  + self.needSavePreResults#忽略
            else:
                needSavePreResultList = self.needSavePreResults.split(';')
                for savePreResult in needSavePreResultList:
                    [key, value] = savePreResult.split('=')
#                    if respDict:
#                        self.getValueFromResp(key, value, respDict)
#                    else:
                    self.getValueFromResp(key,  value, resp)
        except BaseException, e:
            Log.error(e)
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:27,代碼來源:CommonFixture.py

示例5: strToJson

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
def strToJson(data):
    try:
        datajson = json.loads(data)
    except BaseException, e:
        Log.debug("strToJson",  e)
        print e
        datajson = {}
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:9,代碼來源:jsonutil.py

示例6: proceHeadInfo

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def proceHeadInfo(self, info):
     try:
         if info and 'Set-Cookie' in info:
             self.headerinfo = info
             self.cookie = info['Set-Cookie']
     except:
         Log.debug('proceHeadInfo error') 
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:9,代碼來源:__init__.py

示例7: dorequest

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
    def dorequest(self, url, args=None, \
                        content_type=None, \
                        methodname='POST'):
        response = None
        Log.debug('url:', url)
        Log.debug('args:', args)
        self.setHeader()
        if methodname.upper() == 'POST':
            response = self.httppost(url, args, content_type)
        elif methodname.upper() == 'GET':
            response = self.get(url, args, content_type)
        elif methodname.upper() == 'UPLOAD':
            if  os.path.exists(args):
                response = self.uploadfile(url, args, content_type)
            else:
                Log.error('filepath is not exists: ', args)
                response = 'filepath is not exists:'
        else:
            print 'does not implement!'
#        try:
#            cookie = self.getCookie(response.info())
#            self.setCookie(cookie)
#        except:
#            pass
        return response
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:27,代碼來源:__init__.py

示例8: runTest

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def runTest(self):
     Log.debug('start: ExcelTestDriver.runTest')
     fixture = None
     starttime = datetime.datetime.now()
     runTime = 0
     iterationCount = GlobalSetting.ITERATION
     if type(iterationCount) != types.IntType:
         iterationCount = 0
     count = 0
     while True:
         count += 1
         fixture = ExcelColumnFixture()
         excelAPP = util.excel.ExcelAppRD()
         excelAPP.openExcel(self.infilename)
         print 'now start to test......'
         reportFileName = 'report'
         if count > 1:
             reportFileName = 'report' + str(count)
         fixture.dosheets(excelAPP, reportFileName)
         endtime = datetime.datetime.now()
         runTime = (endtime - starttime).seconds
         print 'run time(seconds) is: ' + str(runTime)
         #Log.debug('open report ' + str(fixture.reportNameList))
         fixture.openFileReport()
         if GlobalSetting.RUNTIME > 0:
             if runTime > GlobalSetting.RUNTIME:
                 break
         elif iterationCount < 1:
             break
         iterationCount -= 1
     Log.debug('end: ExcelTestDriver.runTest')
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:33,代碼來源:ExcelTestDriver.py

示例9: getneedSavePreResultkeyRe

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def getneedSavePreResultkeyRe(self, value, key):
     restr = ''
     try:
         restr = '\\"' + key + '\\"' + ':' + '\\"' + value + '\\"'
     except:
         pass
     Log.debug('match re: ', restr)
     return restr
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:10,代碼來源:CommonFixture.py

示例10: openReport

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def openReport(self):
     Log.debug(self.reportNameList)
     for reportName in self.reportNameList:
         try:
             print reportName
             webbrowser.open_new(reportName)
         except BaseException, e:
             Log.exception(e)
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:10,代碼來源:ExcelColumnFixture.py

示例11: setUrl

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def setUrl(self):
     #如果測試用例沒有url列,或者為空,則用表頭的url值
     if not hasattr(self, 'url') or not self.url:
         if self.interface and self.function:
             self.url = self.interface + self.function
         else:
             Log.debug("self.interface or  self.function is none")
             Log.debug("self.url", self.url)
     return self.url
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:11,代碼來源:HttpApiFixture.py

示例12: makeReportTail

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def makeReportTail(self, counts, outputReport=None):
     if outputReport == None:
         outputReport = self.outputReport
     try:
         testResult = 'Test Result: ' + counts.toString()
         outputReport.write('<H2>' + testResult + '</H2>\n')
     except BaseException, e:
         Log.debug('counts')
         Log.debug(e)
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:11,代碼來源:Report.py

示例13: execute

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def execute(self, sql):
     result = False
     try:
         result = self.cur.execute(sql)
         Log.debug("execute sql statement!", sql)
         print "execute sql success"
         result = True
     except Exception, e:
         print "Execute Fail!"
         Log.error("execute sql fail!", e)
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:12,代碼來源:DbUtils.py

示例14: removeChildsOfNode

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def removeChildsOfNode(self, node):
     try:
         if node != None:
             nl = node._get_childNodes()
             for n in nl:
                 if n.nodeType == xml.dom.Node.ELEMENT_NODE:
                     node.removeChild(n)
             Log.debug('have successfully removed element')
     except BaseException, e:
         Log.exception(e)
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:12,代碼來源:XMLConfiguration.py

示例15: fileUpload

# 需要導入模塊: from log.Log import Log [as 別名]
# 或者: from log.Log.Log import debug [as 別名]
 def fileUpload(self):
     reqargs = self.reqargs
     if 'filepath' in self.reqargs:
         self.requestMethod = 'upload'
         filepath = self.reqargs['filepath']
         Log.debug("filepath:", filepath.decode('utf-8').encode('gb2312'))
         reqargs = filepath.decode('utf-8').encode('gb2312')
 #                     self.reqargs = filepath.decode('utf-8').encode('gb2312')
         self.client.referer = "http://pre.moojnn.com/datasource.html" 
     return reqargs
開發者ID:zhukovaskychina,項目名稱:httpautomation,代碼行數:12,代碼來源:TempleteFixture.py


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