Commit 62e34d38 by zhaihuitao

add login enevt

parent 9d8d67a4
......@@ -12,8 +12,6 @@ import random
class randomUtil:
def __init__(self):
pass
def randip(self):
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
......
......@@ -10,10 +10,8 @@ import time
from config.envcfg import prod
from common import randomUtil
params_install = {
"what":'install',
"what": 'install',
"appid": prod['events']['appkey'],
"context": {
"_carrier": "中国联通",
......@@ -23,7 +21,7 @@ params_install = {
"_pkgname": "com.yanjing.yami",
"_campaignid": 'default',
"_deviceid": randomUtil.r.randimei(),
"_imei": "cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1",
"_imei": randomUtil.r.randimei(),
# "_idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
# "_androidid": "43214532142142",
# "_imei2":"324323AAAA",
......@@ -84,4 +82,22 @@ params_startup = {
'who': 'lxx_test'
}
print(params_install)
\ No newline at end of file
params_login = {
# 'what': 'loggedin',
'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",
# '_rydevicetype': rydevicetype,
'_timestamp': int(round(time.time() * 1000)),
# "_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_login.py
@time: 2020/8/18 15:54
@desc:
"""
import unittest
import json
import requests
from config.envcfg import prod, headers
from config.prod.params import params_login
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)
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