1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
55
56
57
58
59
60
61
62
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_click.py
@time: 2020/8/5 14:48
@desc:
"""
import unittest
from config.envcfg import prod
from common import randomUtil
from config.prod.params import params_click
import requests
import os
import sys
base_path = os.getcwd()
sys.path.append(base_path)
class clickTestCase(unittest.TestCase):
def click(self):
try:
p = requests.get(url=prod['click']['url'], params=params_click, timeout=30, verify=False)
# self.assertEqual(p.status_code, 200, msg='接口异常,请检查')
print(prod['click']['url'])
print('执行结果:\n=================')
print(p)
print('imei:', randomUtil.r.randimei())
except requests.exceptions.RequestException:
print('imei:', randomUtil.r.randimei())
print('ip', randomUtil.r.randip())
# 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)