def setUp(self): """ :return: """ self.log = MyLog.get_log() self.logger = self.log.get_logger()
def setUp(self): """ :return: """ self.log = MyLog.get_log() self.logger = self.log.get_logger() self.login_token = businessCommon.login()
def __init__(self): global log, logger, resultPath, on_off log = Log.get_log() logger = log.get_logger() resultPath = log.get_report_path() on_off = localReadConfig.get_email("on_off") self.caseListFile = os.path.join(readConfig.proDir, "caselist.txt") self.caseFile = os.path.join(readConfig.proDir, "testCase") # self.caseFile = None self.caseList = [] self.email = MyEmail.get_email()
def __init__(self): global scheme, host, port, timeout, sessionid scheme = localReadConfig.get_http("scheme") host = localReadConfig.get_http("baseurl") port = localReadConfig.get_http("port") timeout = localReadConfig.get_http("timeout") sessionid = localReadConfig.get_headers("cookie") self.log = Log.get_log() self.logger = self.log.get_logger() self.headers = {} self.params = {} self.data = {} self.url = None self.files = {} self.state = 0
def __init__(self): global host, user, password, port, sender, title host = localReadConfig.get_email("mail_host") user = localReadConfig.get_email("mail_user") password = localReadConfig.get_email("mail_pass") port = localReadConfig.get_email("mail_port") sender = localReadConfig.get_email("sender") title = localReadConfig.get_email("subject") # content = localReadConfig.get_email("content") # get receiver list self.value = localReadConfig.get_email("receiver") self.receiver = [] for n in str(self.value).split("/"): self.receiver.append(n) # defined email subject date = datetime.now().strftime("%Y-%m-%d %H:%M:%S") self.subject = "接口测试报告" + " " + date self.log = MyLog.get_log() self.logger = self.log.get_logger() self.msg = MIMEMultipart('related')
def __init__(self): self.log = Log.get_log() self.logger = self.log.get_logger() self.db = None self.cursor = None
import requests import readConfig as readConfig import os from xlutils.copy import copy import xlwt import xlrd from xlrd import open_workbook from xml.etree import ElementTree as ElementTree from common1 import configHttp from common1.Log import MyLog as Log import json localReadConfig = readConfig.ReadConfig() proDir = readConfig.proDir localConfigHttp = configHttp.ConfigHttp() log = Log.get_log() logger = log.get_logger() caseNo = 0 def get_visitor_token(): """ create a token for visitor :return: """ host = localReadConfig.get_http("BASEURL") response = requests.get(host + "/v2/user/Token/generate") info = response.json() token = info.get("info") logger.debug("Create token:%s" % (token))