Ejemplo n.º 1
0
提现  登陆接口返回值里的 token,member_id
加标  
"""
import unittest
from Common.handle_phone import get_new_phone
from Common.handle_data import EnvData, replace_case_by_regular, clear_EnvData_attrs
from Common.myddt import ddt, data

from Common.handle_excel import HandleExcel
from Common.handle_path import datas_dir
from Common.handle_requests import send_requests
from Common.handle_extract_data_from_response import extract_data_from_response

he = HandleExcel(datas_dir + "\\api_cases.xlsx", "业务流")
cases = he.read_all_datas()
he.close_file()


@ddt
class TestUserBusiness(unittest.TestCase):
    @classmethod
    def setUpClass(cls) -> None:
        # 清理环境变量EnvData
        clear_EnvData_attrs()

        # 生成一个新的手机号码。设置为全局变量。
        new_phone = get_new_phone()
        setattr(EnvData, "phone", new_phone)

    @data(*cases)
    def test_user_business(self, case):
Ejemplo n.º 2
0
 def obtain_datas(self):
     case_path = os.path.join(test_datas_dir, self.table_name)
     case_datas = HandleExcel(case_path, self.sheet_names)
     case_all_datas = case_datas.read_test_cases_datas()
     case_datas.close_file()
     return case_all_datas