Exemple #1
0
import unittest
import paramunittest
import readConfig as readConfig
import Log
import common
import configHttp as ConfigHttp
import json

queryAccountBill_xls = common.get_xls("userCase.xlsx", "queryAccountBill")
localReadConfig = readConfig.ReadConfig()
configHttp = ConfigHttp.ConfigHttp()
info = {}

@paramunittest.parametrized(*queryAccountBill_xls)

class queryAccountBill(unittest.TestCase):
    def setParameters(self,case_name,method,token,phoneNumber,billTime,status,msg):

        self.case_name = str(case_name)
        self.method = str(method)
        self.token = str(token)
        self.phoneNumber = str(phoneNumber)
        self.billTime = str(billTime)
        self.status = str(status)
        self.msg = str(msg)
        self.ret = None
        self.info = None

    def description(self):
        self.case_name
Exemple #2
0
import requests
import readConfig as readConfig
import os
from xlrd import open_workbook
from xml.etree import ElementTree as ElementTree
import configHttp as configHttp
from Log import MyLog
import json

localReadConfig = readConfig.ReadConfig()
proDir = readConfig.proDir
localConfigHttp = configHttp.ConfigHttp()
log = MyLog.get_log()
logger = log.get_logger()

caseNo = 0


def get_xls(xls_name, sheet_name):
    cls = []
    # get xls file's path
    xlsPath = os.path.join(proDir, "testFile", 'case', 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))