Commit 9a878286 by zhaihuitao

update

parent c75c84cf
......@@ -19,8 +19,10 @@ prod = {
"appkey": "9b17c1568c3ce34599c5fd2778483ff9"
},
"events": {
"url": "http://tlog.trackingio.com/receive/tkio/",
"appkey": "9b17c1568c3ce34599c5fd2778483ff9",
# "url": "http://tlog.trackingio.com/receive/tkio/",
"url": "http://10.3.20.42:8080",
"interface": "/receive/tkiov2/install",
"appkey": "b58f29d64718c6723895cb8a2389258c",
},
}
......
......@@ -84,6 +84,7 @@ params_install = {
"_istablet": "phone",
"_lib": "Android",
"_lib_version": "1.5.0",
"X-RY-Access-Token": "4131e3fee2034592b3d355611e7d71ae"
},
# '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()))
......@@ -373,4 +374,108 @@ params_appduration = {
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who': 'lxx_test'
}
params_batchUpload1 = {
"from": "tkio", "data": [
{"appid": prod['events']['appkey'],
"when": "2018-01-08 11:22:42",
"what": "startup",
"context": {"_manufacturer": "苹果",
"_carrier": "unknown",
"_lats": "1",
"_jbk": "1",
"_app_version": "1.0",
"_timestamp": "1515381771925",
"_create_timestamp": "1515381762624",
"_rydevicetype": "iPhone",
"_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8",
"_resolution": "667*375",
"_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE",
"_network_type": "NO CONNECT",
"_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3",
"_ryosversion": "11.2",
"_model": "iPhone Simulator",
"_lib_version": "2.0.0",
"_ryos": "ios",
"_campaignid": "channelid",
"_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "unknown"},
{"appid": prod['events']['appkey'],
"when": "2018-01-08 11:22:42",
"what": "register",
"context": {"_manufacturer": "苹果",
"_carrier": "unknown",
"_lats": "1",
"_jbk": "1",
"_app_version": "1.0",
"_timestamp": "1515381771925",
"_create_timestamp": "1515381762657",
"_rydevicetype": "iPhone",
"_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8",
"_resolution": "667*375",
"_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE",
"_network_type": "NO CONNECT",
"_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3",
"_ryosversion": "11.2",
"_model": "iPhone Simulator",
"_lib_version": "2.0.0",
"_ryos": "ios",
"_campaignid": "channelid",
"_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "acc1"}],
}
params_batchUpload = {
"from": "tkio", "data": [
{"appid": prod['events']['appkey'], "when": "2018-01-08 11:22:42", "what": "startup",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": "1515381771925", "_create_timestamp": "1515381762624",
"_rydevicetype": "iPhone", "_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "unknown"},
{"appid": prod['events']['appkey'], "when": "2018-01-08 11:22:42", "what": "register",
"context": {"_manufacturer": "苹果", "_carrier": "unknown", "_lats": "1", "_jbk": "1",
"_app_version": "1.0", "_timestamp": "1515381771925", "_create_timestamp": "1515381762657",
"_rydevicetype": "iPhone", "_deviceid": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E",
"_tz": "+8", "_resolution": "667*375", "_pkgname": "com.reyun.testapp",
"_mac": "80:E6:50:12:4C:DE", "_network_type": "NO CONNECT", "_istf": "8",
"_idfv": "27CCEE6E-5ED1-47EC-B486-81F9129C05D3", "_ryosversion": "11.2",
"_model": "iPhone Simulator", "_lib_version": "2.0.0", "_ryos": "ios",
"_campaignid": "channelid", "_idfa": "FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"},
"who": "acc1"},
]
}
params_h5 = {
"what": "download",
"appType": "wap",
"appid": prod['events']['appkey'],
"context": {
"_campaignid": "_default_",
"_deviceid": randomUtil.r.randimei(),
"_cid": "-1",
"_ry_ts": "1588130655311",
"_tz": "+8",
"_ip": randomUtil.r.randip(),
"_apptype": "wap",
"_campaignid_bak": "_default_",
"_ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36",
"_cid_bak": "-1"
},
"where": "event",
"deviceid": randomUtil.r.randimei(),
"when": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
"ds": time.strftime('%Y-%m-%d', time.localtime(time.time())),
"who": "552317006484"
}
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_batchUpload.py
@time: 2020/8/25 15:24
@desc:
"""
import unittest
import json
import requests
from config.envcfg import prod, headers
from config.prod.params import params_batchUpload
class batchUploadTestCase(unittest.TestCase):
def testbatchUpload(self):
p = requests.post(url=prod['events']['url'], data=json.dumps(params_batchUpload), headers=headers, timeout=5)
print("自定义" + p.text)
......@@ -14,10 +14,10 @@ from config.prod.params import params_install
class installTestCase(unittest.TestCase):
def testinstall(self):
r = requests.post(url=prod["events"]["url"] + 'install', data=json.dumps(params_install), headers=headers)
print("激活事件执行结果:" + r.text)
r = requests.post(url=prod["events"]["url"] + prod['events']['interface'], data=json.dumps(params_install), headers=headers)
print("\n激活事件执行结果:" + r.text)
print(r.url)
self.assertEqual(r.status_code, 200, msg="执行失败,请检查")
#self.assertEqual(r.status_code, 200, msg="执行失败,请检查")
if __name__ == "__main__":
unittest.main()
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: tokenTest.py
@time: 2020/8/27 16:36
@desc:
"""
import requests
import json
URL = 'http://10.3.20.41:9003/api/tkio/authorization_token'
headers = {'Content-Type': 'application/json'}
params_token = {
"appid": "03cca1a7459b7794147f0f94cbbdbd9f",
"appsecret": "1B05F022413F180F53CC21B6C4579D37"
}
r = requests.post(url=URL, data=json.dumps(params_token), headers=headers, timeout=10)
print(r.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