Commit 153ffcb9 by zhaihuitao

add formate enevt

parent f707dbab
......@@ -147,27 +147,47 @@ params_login = {
}
params_formate = {
"appid": appkey,
"appid": prod['events']['appkey'],
"context": {
"_campaignid": 'default',
"_deviceid": i,
"_imei": i,
"_deviceid": randomUtil.r.randimei(),
"_imei": randomUtil.r.randimei(),
# "_imei2":i,
# "_oaid":i,
# "_meid":i,
"_androidid": "2342312",
"_ip": IP,
'_manufacturer': manufacturer,
'_ryos': ryos,
'_rydevicetype': rydevicetype,
'_network': network,
'_resolution': resolution,
'_op': op,
"_lib_version": lv,
"_ip": randomUtil.r.randip(),
'_manufacturer': "vivo",
'_ryos': "android",
'_rydevicetype': "vivox9",
'_network': "wifi",
'_resolution': "1344*750",
'_op': "中国移动",
"_lib_version": "1.5.0",
'_timestamp': "aaa"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
# 'ds': ds,
'who': 'lxx_test'
}
params_register = {
'what':'register',
'appid': prod['events']['appkey'],
'context': {
'_deviceid': randomUtil.r.randimei(),
# '_imei':i,
# '_androidid':i,
'_ip': randomUtil.r.randip(),
'_timestamp': int(round(time.time() * 1000)),
'_oaid': randomUtil.r.randimei(),
"_lib_version": "1.5.0",
# "_idfa": "00000000-0000-0000-0000-000000000000",
# "_idfv": ""
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
}
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_register.py
@time: 2020/8/20 11:24
@desc: register event
"""
import unittest
import json
import requests
from config.envcfg import prod, headers
from config.prod.params import params_register
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
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