Commit 2b859933 by zhaihuitao

update

parent bb218573
......@@ -287,3 +287,31 @@ params_adshow = {
'who': 'lxx_test'
}
params_adclick = {
"appid": prod['events']['appkey'],
"context": {
'_adPlatform': "mintegral",
'_adId': "adid",
"_campaignid": 'default',
"_deviceid": randomUtil.r.randimei(),
"_imei": randomUtil.r.randimei(),
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": randomUtil.r.randip(),
# "_ipv6": i,
'_manufacturer': "vivo",
'_ryos': "android",
'_rydevicetype': "vivox9",
'_network': "wifi",
'_resolution': "1344*750",
'_op': "中国移动",
'_timestamp': int(round(time.time() * 1000)),
'_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
}
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_adclick.py
@time: 2020/8/24 15:54
@desc:
"""
import unittest
import json
import requests
from config.envcfg import prod, headers
from config.prod.params import params_adclick
class adclickTestCase(unittest.TestCase):
def testadclick(self):
r = requests.post(url=prod['events']['url'] + 'adclick', data=json.dumps(params_adclick), headers=headers, timeout=5)
print("广告点击:" + r.text)
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
......@@ -16,4 +16,7 @@ from config.prod.params import params_adshow
class adshowTestCase(unittest.TestCase):
def testadshow(self):
r = requests.post(url=prod['events']['url'] + 'adshow', data=json.dumps(params_adshow), headers=headers, timeout=5)
print("\n广告展示:" + r.text)
\ No newline at end of file
print("\n广告展示:" + r.text)
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
......@@ -16,4 +16,7 @@ from config.prod.params import params_custom
class customTestCase(unittest.TestCase):
def testcustom(self):
p = requests.post(url=prod['events']['url'] + 'event', data=json.dumps(params_custom), headers=headers, timeout=5)
print("自定义" + p.text)
\ No newline at end of file
print("自定义" + p.text)
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
......@@ -17,3 +17,6 @@ class loninTestCase(unittest.TestCase):
def testlogin(self):
r = requests.post(url=prod['events']['url']+ 'loggedin', data=json.dumps(params_login), headers=headers, timeout=10)
print("登录" + r.text)
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
......@@ -20,3 +20,6 @@ class payTestCase(unittest.TestCase):
print(prod['events']['url'] + 'payment')
print(json.dumps(params_pay))
print(r)
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
......@@ -16,4 +16,7 @@ from config.prod.params import params_payorder
class payorderTestCase(unittest.TestCase):
def testpayorder(self):
p = requests.post(url=prod['events']['url'] + 'order', data=json.dumps(params_payorder), headers=headers, timeout=5)
print("订单" + p.text)
\ No newline at end of file
print("订单" + p.text)
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
......@@ -18,4 +18,7 @@ class registerTestCase(unittest.TestCase):
def testregister(self):
p = requests.post(url=prod['events']['url'] + 'register', data=json.dumps(params_register), headers=headers, timeout=10)
# print("注册时间戳"+current_time_13)
print("注册" + p.text)
\ No newline at end of file
print("注册" + p.text)
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment