Commit bb218573 by zhaihuitao

add adshow enevt

parent 21bcd882
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
""" """
import time import time
import random
from config.envcfg import prod from config.envcfg import prod
from common import randomUtil from common import randomUtil
...@@ -217,3 +216,74 @@ params_pay = { ...@@ -217,3 +216,74 @@ params_pay = {
# 'ds': ds, # 'ds': ds,
'who': 'lxx_test' 'who': 'lxx_test'
} }
params_payorder = {
'what': "order",
'appid': prod['events']['appkey'],
'context': {
'_deviceid': randomUtil.r.randimei(),
'_imei': randomUtil.r.randimei(),
'_androidid': randomUtil.r.randimei(),
'_ip': randomUtil.r.randip(),
'_timestamp': int(round(time.time() * 1000)),
'_transactionid': randomUtil.r.transactionid(),
'_paymenttype': "alipay",
"_lib_version": "1.5.0",
'_currencytype': "CNY",
'_ryos': "android",
'_currencyamount': "10",
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
}
params_custom = {
'what': "event",
'appid': prod['events']['appkey'],
'context': {
'_deviceid': randomUtil.r.randimei(),
'_imei': randomUtil.r.randimei(),
'_androidid': randomUtil.r.randimei(),
'_ip': randomUtil.r.randip(),
'_ryos': "android",
"_lib_version": "1..5.0",
# 识别是否为自定义事件,默认传1
'_isreyundefaultevent': '1'
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
}
params_adshow = {
"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',
"_fill": "1",
# '_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_adshow.py
@time: 2020/8/21 18:00
@desc:
"""
import unittest
import json
import requests
from config.envcfg import prod, headers
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
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_custom.py
@time: 2020/8/21 15:38
@desc:
"""
import unittest
import json
import requests
from config.envcfg import prod, headers
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
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
@author:zhaiht @author:zhaiht
@file: test_pay.py @file: test_payment.py
@time: 2020/8/20 15:43 @time: 2020/8/20 15:43
@desc: @desc:
""" """
......
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_payorder.py
@time: 2020/8/21 11:30
@desc:
"""
import unittest
import json
import requests
from config.envcfg import prod, headers
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
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