test_click.py 1.69 KB
Newer Older
1 2 3 4 5 6 7 8 9
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file:  test_click.py
@time:  2020/8/5 14:48
@desc:
"""

import unittest
zhaihuitao committed
10
from config.envcfg import prod_click_url
zhaihuitao committed
11
from config.prod.params import params_click
12
import requests
zhaihuitao committed
13
import os
14
import sys
zhaihuitao committed
15

zhaihuitao committed
16 17
base_path = os.getcwd()
sys.path.append(base_path)
18

zhaihuitao committed
19

20
class clickTestCase(unittest.TestCase):
zhaihuitao committed
21
    def testclick(self):
zhaihuitao committed
22 23
            p = requests.get(url=prod_click_url, params=params_click, timeout=30, verify=False)
            # self.assertEqual(p.status_code, 300, msg='接口异常,请检查')
zhaihuitao committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
            print('执行结果:\n=================')
            print(p)
            # time.sleep(7)
            # try:
                # allEvent().installUpload(randomUtil.r.randimei(), randomUtil.r.randip(), prod['events']['appkey'], prod['cmpaignid'])
            # except Exception as err:
            #     print('install_wrong:', w)
            #     w = w + 1
            #     print(err)
            # time.sleep(1)
            # try:
            #     allEvent().registerEvent(i, ip, appkey)
            # except Exception as e:
            #     print('注册_wrong:', w)
            #     print(e)
            # #     continue
            # time.sleep(2)
            # try:
            #     allEvent().loginEvent(i, ip, appkey)
            # except Exception:
            #     print('登录_wrong:', w)
            # time.sleep(5)
            # try:
            #     allEvent().payEvent(i, ip, appkey)
            # except Exception:
            #     print('付费_wrong:', w)
            # time.sleep(2)
            # try:
            #     allEvent().ziding_event(i, ip, appkey,event)
            # except Exception:
            #     print('自定义_wrong:', w)