예제 #1
0
    def setUp(self):
        """

        :return:
        """
        self.log = MyLog.get_log()
        self.logger = self.log.get_logger()
예제 #2
0
    def setUp(self):
        """

        :return:
        """
        self.log = MyLog.get_log()
        self.logger = self.log.get_logger()
        self.logintoken = businessCommon.login()
예제 #3
0
 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 host, port, timeout
     host = localReadConfig.get_http("baseurl")
     port = localReadConfig.get_http("port")
     timeout = localReadConfig.get_http("timeout")
     self.log = Log.get_log()
     self.logger = self.log.get_logger()
     self.headers = {}
     self.param = {}
     self.data = {}
     self.url = None
     self.files = {}
예제 #5
0
 def __init__(self):
     global scheme, host, timeout
     scheme = localReadConfig.get_http("scheme")
     host = localReadConfig.get_http("baseurl")
     timeout = localReadConfig.get_http("timeout")
     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
예제 #6
0
파일: configHttp.py 프로젝트: bopopescu/RY
 def __init__(self):
     global scheme, host, port, timeout
     scheme = localReadConfig.get_http("scheme")
     host = localReadConfig.get_http("baseurl")
     port = localReadConfig.get_http("port")
     timeout = localReadConfig.get_http("timeout")
     #真正调用了Log示例,在线程中只有一个线程在执行(线程锁)
     self.log = Log.get_log()
     self.logger = self.log.get_logger()
     #print self.logger
     self.url = None
     self.headers = {}
     self.params = {}
     self.data = {}
     self.files = {}
     self.state = 0
예제 #7
0
    def __init__(self):
        global host, user, password, port, sender, title, content
        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")
        self.value = localReadConfig.get_email("receiver")
        self.recerver = []

        # get receiver list
        for n in str(self.value).split("/"):
            self.recerver.append(n)

        # defined email subject
        date = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
        self.subject = title + " " + date
        self.log = MyLog.get_log()
        self.msg = MIMEMultipart('mixed')
예제 #8
0
import os
from xlrd import open_workbook
from xml.etree import ElementTree as ElementTree
from interfaceTest.common.Log import MyLog as Log

from interfaceTest.common import configHttp
from interfaceTest.readConfig import proDir

localConfigHttp = configHttp.ConfigHttp()
log = Log.get_log()
logger = log.get_logger()


# 从excel文件中读取测试用例
def get_xls(xls_name, sheet_name):
    cls = []
    # get xls file's path
    xlsPath = os.path.join(proDir, "testFile", xls_name)
    # open xls file
    file = open_workbook(xlsPath)
    # get sheet by name
    sheet = file.sheet_by_name(sheet_name)
    # get one sheet's rows
    nrows = sheet.nrows
    for i in range(nrows):
        if sheet.row_values(i)[0] != u'case_name':
            cls.append(sheet.row_values(i))
    return cls


# 从xml文件中读取sql语句
예제 #9
0
 def __init__(self):
     self.log = Log.get_log()
     self.logger = self.log.get_logger()
     self.db = None
     self.cursor = None