import unittest import paramunittest import readConfig as readConfig from utrl import configHttp from utrl import businessCommon from utrl import common_1 from utrl.Log import MyLog localReadConfig = readConfig.ReadConfig() localConfigHttp = configHttp.ConfigHttp() localUpdatePassword_xls = common_1.get_xls("userCase.xlsx", "updatePassword") @paramunittest.parametrized(*localUpdatePassword_xls) class UpdatePassword(unittest.TestCase): def setParameters(self, case_name, method, token, old_password, password, password_confirm, result, code, msg): """ set parameters :param case_name: :param method: :param token: :param old_password: :param password: :param password_confirm: :param result: :param code: :param msg: :return: """ self.case_name = str(case_name)
import unittest import paramunittest import readConfig as readConfig from utrl import Log as Log from utrl import common_1 from utrl import configHttp as ConfigHttp from utrl import businessCommon addressList_xls = common_1.get_xls("userCase.xlsx", "getAddressList") localReadConfig = readConfig.ReadConfig() configHttp = ConfigHttp.ConfigHttp() info = {} @paramunittest.parametrized(*addressList_xls) class GetAddressList(unittest.TestCase): def setParameters(self, case_name, method, token, result, code, msg): """ set params :param case_name: :param method: :param token: :param result: :param code: :param msg: :return: """ self.case_name = str(case_name) self.method = str(method) self.token = str(token) self.result = str(result)
import unittest import paramunittest import readConfig as readConfig from utrl.Log import MyLog from utrl import common_1 from utrl import configHttp localReadConfig = readConfig.ReadConfig() localConfigHttp = configHttp.ConfigHttp() localLoginFB_xls = common_1.get_xls("userCase.xlsx", "loginFB") @paramunittest.parametrized(*localLoginFB_xls) class LoginFB(unittest.TestCase): def setParameters(self, case_name, method, token, email, facebook_id, fbtoken, invite_agency, code, msg): """ set parameters :param case_name: :param method: :param token: :param email: :param facebook_id: :param fbtoken: :param invite_agency: :param code: :param msg: :return: """ self.case_name = str(case_name) self.method = str(method)
import readConfig as readConfig import unittest import paramunittest from utrl.Log import MyLog from utrl import configHttp from utrl import common_1 from utrl import configDB localRegisterQuick_xls = common_1.get_xls("userCase.xlsx", "registerquick") localReadConfig = readConfig.ReadConfig() localConfigHttp = configHttp.ConfigHttp() localConfigDB = configDB.MyDB() @paramunittest.parametrized(*localRegisterQuick_xls) class RegisterQuick(unittest.TestCase): def setParameters(self, case_name, method, token, email, result, code, msg): """ set parameters :param case_name: :param method: :param token: :param email: :param result: :param code: :param msg: :return: """ self.case_name = str(case_name) self.method = str(method)
import unittest import paramunittest import readConfig as ReadConfig from utrl.Log import MyLog from utrl import common_1 from utrl import configHttp from utrl import businessCommon localReadConfig = ReadConfig.ReadConfig() localConfigHttp = configHttp.ConfigHttp() localLogout_xls = common_1.get_xls("userCase.xlsx", "logout") @paramunittest.parametrized(*localLogout_xls) class Logout(unittest.TestCase): def setParameters(self, case_name, method, token, result, code, msg): """ set parameters :param case_name: :param method: :param token: :param result: :param code: :param msg: :return: """ self.case_name = str(case_name) self.method = str(method) self.token = str(token) self.result = str(result)
import readConfig as readConfig from utrl.Log import MyLog from utrl import configHttp from utrl import common_1 import unittest import paramunittest from utrl import configDB register_xls = common_1.get_xls("userCase.xlsx", "register") localConfigHttp = configHttp.ConfigHttp() localReadConfig = readConfig.ReadConfig() localConfigDB = configDB.MyDB() @paramunittest.parametrized(*register_xls) class Register(unittest.TestCase): def setParameters(self, case_name, method, token, email, password, confirmpwd, result, code, msg): """ set parameters :param case_name: :param method: :param token: :param email: :param password: :param confirmpwd: :param result: :param code: :param msg: :return: """
from utrl import common_1 from utrl import configHttp import readConfig as readConfig localReadConfig = readConfig.ReadConfig() localConfigHttp = configHttp.ConfigHttp() localLogin_xls = common_1.get_xls("userCase.xlsx", "login") localAddAddress_xls = common_1.get_xls("userCase.xlsx", "addAddress") # login def login(): """ login :return: token """ # set url url = common_1.get_url_from_xml('login') localConfigHttp.set_url(url) # set header token = localReadConfig.get_headers("token_v") header = {"token": token} localConfigHttp.set_headers(header) # set param data = {"email": localLogin_xls[0][3], "password": localLogin_xls[0][4]} localConfigHttp.set_data(data) # login response = localConfigHttp.post().json()
import unittest import paramunittest import readConfig as readConfig from utrl import Log as Log from utrl import common_1 from utrl import configHttp as ConfigHttp from utrl import businessCommon getAddress_xls = common_1.get_xls("userCase.xlsx", "getAddress") localReadConfig = readConfig.ReadConfig() configHttp = ConfigHttp.ConfigHttp() info = {} @paramunittest.parametrized(*getAddress_xls) class GetAddress(unittest.TestCase): def setParameters(self, case_name, method, token, address_id, result, code, msg): """ set params :param case_name: :param method: :param token: :param address_id: :param result: :param code: :param msg: :return: """ self.case_name = str(case_name) self.method = str(method)