Esempio n. 1
0
# -*- coding: utf-8 -*-
# @time:2019/4/19 10:44
# Author:殇殇
# @file:test_bidloan.py
# @fuction: 测试投资,竞标
import unittest
from ddt import ddt, data
from interface_practice.common.do_excel import DoExcel
from interface_practice.common.do_request import HttpRequest
from interface_practice.common.contants import *
from interface_practice.common.my_log import MyLog
from interface_practice.common.re_context import replace, Context
from interface_practice.common.do_mysql import DoMysql

my_log = MyLog(__name__)  # 对象实例化
do_excel = DoExcel(case_file, 'bidloan')
bidloan_cases = do_excel.get_data()


@ddt
class BidloanTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        my_log.info('-----开始执行测试用例-----')
        cls.do_request = HttpRequest()
        cls.mysql = DoMysql()

    @data(*bidloan_cases)
    def test_bidloan(self, case):
        case.data = replace(case.data)
        my_log.info('开始执行第{}条测试用例:{}'.format(case.case_id, case.title))
Esempio n. 2
0
# -*- coding: utf-8 -*-
# @time:2019/4/17 14:44
# Author:yh
# @file:test_register.py

import unittest
from ddt import ddt, data
from interface_practice.common.do_request import HttpRequest
from interface_practice.common.do_excel import DoExcel
from interface_practice.common.contants import case_file
from interface_practice.common.my_log import MyLog
from interface_practice.common.do_mysql import DoMysql
import random

my_log = MyLog(__name__)

do_excel = DoExcel(case_file, 'register')
register_cases = do_excel.get_data()


@ddt
class RegisterTest(unittest.TestCase):
    '''
    setup(self)每个测试用例之前都加载一次,
    setUpClass(cls) 类方法 所有用例 执行一次
    '''
    @classmethod
    def setUpClass(cls):
        my_log.info('-----测试用例开始执行-----')
        cls.do_request = HttpRequest()
        cls.db = DoMysql()
Esempio n. 3
0
# -*- coding: utf-8 -*-
# @time:2019/4/19 10:28
# Author:殇殇
# @file:test_audit.py
# @fuction: 测试审核功能

import unittest
from ddt import ddt,data
from interface_practice.common.do_excel import DoExcel
from interface_practice.common.do_request import HttpRequest
from interface_practice.common.contants import *
from interface_practice.common.my_log import MyLog
from interface_practice.common.re_context import replace

my_log = MyLog(__name__)  # 对象实例化

do_excel = DoExcel(case_file,'audit')
audit_cases = do_excel.get_data()


@ddt
class AuditTest(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        my_log.info('-----测试用例开始执行-----')
        cls.do_request = HttpRequest()

    @data(*audit_cases)
    def test_audit(self,case):
        # 替换参数化的值