Commit c5c8f3aa by liuxiaoxing

微服务测试用例

parent cf614b4d
......@@ -26,7 +26,7 @@ ry_adplan_name = '新版测试-计划'
ry_adcreative_name = '新版测试创意'
# bytedance_int 今日头条,kuaishou_int 快手,tencentams_int (新)广点通,rryingxiao_int 人人营销
pid = 'rryingxiao_int'
URL = 'http://10.2.20.42:8083/tkio/MrYbuaa?noredirect=true'
URL = 'http://uri6.com/tkio/2MRFZra?noredirect=true'
# 测试头条衍生事件回调时加上
# callback= http%3A%2F%2Fad.toutiao.com%2Ftrack%2Factivate%2F%3Fcallback%3DCKP4rs-Zn4QDEKiQ6teZn4QDGN6L8Y-h9Wcg3ovxj6H1ZyiE0PjgroSEAzAOOM_X-8IDQik0YWY1NzdlOC1lZmViLTRmZDEtYmZkZC00MzE1Zjc1MmJhMGF1NTQ5M0iA0pOtA1AAiAEAkAECmAEA%26os%3D0%26muid%3D
# URL = 'http://uri6.com/adapt/encryp/love.match.set-bytedance?noredirect=true&pid=rryingxiao_int&callback=D8311DBF28D751F327B83F7CEE5B8850B88CC74C8C3FF628EB3A48CAE2212EE260EE347E1771382C5F1B2C0FC9E8921CB5245576D7E5C1EF680315AAA98DCFB189F66FBA49CC7BCB8E4B4726D6D363B816BB2133CADC80B1C12D9FE464A05ED974A70A646BAB1D4D78E2A75361676D5A0D3D4E52B7E7C6B72E9388C17FE9384BE1A47503AABEFB9423727DBAC7B7275AAD237E0E2774D2A8C3D0FDC895CE10C0CCE38F8FEDBC24AF2E23B2B5E742B50C07744361334E148979087917DFFFC445A74B9F939412DEF8D060474E1D353ED7E2EB636B32CADF29842BB90E2131BD3ED05D1A0438EA0EA8577613780B3D64377D85E758A2B20507A034A2C8A96077C7E200C410188C78F76B9B5E7F3E5E4AC3'
......@@ -39,7 +39,7 @@ URL = 'http://10.2.20.42:8083/tkio/MrYbuaa?noredirect=true'
# 7e3aa681f68435b3f74de790d6424690
# 4eab4be709defbfc2cc85826b09caea0
# 6ba2b016f280004d10a1a354e426eceb
appkey = 'bf3b409800af7328042de440f2fb7917'
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
lst = []
nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
s = 0
......@@ -80,14 +80,14 @@ for index in range(1):
# ip = '156.119.456.199'
try:
parms = {
# 'androidid': '',
# 'androidid': '86a069b7f6642bdde717709216e68d0b',
'imei': i,
# 'campuuid': '@#¥%……&……%¥#@#¥%&……&*****',
# 'clickid': '测试测试',
# "idfa": '00000000-0000-0000-0000-000000000000',
# 'gxid': '78B5382F687FAD16E75F5DDDC7745013',
# 'caid': '00_A0FF634AEDF1403205A4A6A1118CDA61_A66338F33BEBB40F5CD65F198AF2F40C',
# 'oaid': '',
'oaid': '697134960e9ff8df46f21b4f97db595a',
# 'oaid_MD5': '9f89c84a559f573636a47ff8daed0d33',
'ip': ip,
# 'pid': pid,
......
......@@ -79,13 +79,13 @@ class allEvent:
# "_campaignid": 'default',
"_deviceid": i,
"_imei": i,
# '_oaid': '875643256870978657463524',
'_oaid': '4532432432r3r3455r34rt5',
# 'ua': 'Mozilla/5.0 (Linux; U; Android 7.0; zh-CN; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/40.0.2214.89 UCBrowser/11.4.5.937 Mobile Safari/537.36',
# "idfa": i,
# "_current_caid": "00_A0FF634AEDF1403205A4A6A1118CDA61_A66338F33BEBB40F5CD65F198AF2F40C",
# "gxid": "876543567543565",
# "_idfv": i,
# "_androidid": i,
"_androidid": 'dewry3487ryd3478r34r',
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": IP,
......
......@@ -8,7 +8,7 @@ import hashlib
#安卓常规渠道激活
appkey = 'bf3b409800af7328042de440f2fb7917'
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
# 线上预约app
# 7f64fbd64513bc74aa6b5bf753ae0953
# 16dc0cb882d3dbec4f7f66251a84d6dd
......@@ -37,8 +37,8 @@ for index in range(1):
# p = '987654321234567'
# s = '2321321312h8ro321'
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
i = '213416723004'
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '76532423423422'
# i = '00000000-0000-0000-0000-000000000000'
# 随机生成ipXXXX XXCB489741-0029-4A35-8E38-D142F836B623
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
......@@ -47,7 +47,7 @@ for index in range(1):
# 60.13.148.23 新疆维吾尔自治区吐鲁番市
# 61.139.239.255 广西壮族自治区北海市
# 119.60.0.0 宁夏回族自治区银川市
# allEvent().installUpload(i, ip, appkey)
allEvent().installUpload(i, ip, appkey)
# time.sleep(1)
# allEvent().startupEvent(i, ip, appkey)
# time.sleep(1)
......@@ -60,8 +60,8 @@ for index in range(1):
# time.sleep(1)
# num = index + 1
# event = 'event_' + str(num)
event = 'event_20'
allEvent().ziding_event(i, ip, appkey, event)
# event = 'event_20'
# allEvent().ziding_event(i, ip, appkey, event)
# print(s)
# s = int(s) + 1
# time.sleep(3)
......
......@@ -8,8 +8,8 @@ import string
#向短链发送点击数据
#渠道短链
URL = 'http://uri6.com/tkio/zy2aEba?noredirect=true'
appkey = '0d401839250deff23daf62fd49a444cb'
URL = 'http://uri6.com/tkio/2MRFZra?noredirect=true'
appkey = 'cd9a88d26f715c3a0503dd9a1476cccd'
# URL = 'http://172.31.19.255:8083/tkio/VNNjQra'
event = 'event_1'
# 广告创意ID
......@@ -38,9 +38,11 @@ for _ in range(1):
d = "".join(random.sample(string.ascii_letters+string.digits, 4))
e = "".join(random.sample(string.ascii_letters+string.digits, 12))
i = (a+"-"+b+"-"+c+"-"+d+"-"+e).upper()
# i = (a+"-"+b+"-"+c+"-"+d+"-"+e).upper()
# i = '00000000-0000-0000-0000-000000000000'
i = '8a517deb7c54ac34e4a3e21f84ab6aae84d7696e'
# i = 'IFV_05B50501-E0FC-4B83-BE74-F18ACEDEF37Bwew'
adid = ''.join(str(random.choice(range(10))) for _ in range(12))
p1 = ''.join(str(random.choice(range(10))) for _ in range(12))
se = ''.join(str(random.choice(range(10))) for _ in range(12))
......@@ -87,14 +89,14 @@ for _ in range(1):
print('idfa:', i)
print('ip', ip)
w=w+1
time.sleep(10)
try:
allEvent().installUpload(i, ip, appkey)
# allEvent().formevent(i, ip, appkey)
except Exception:
print('install_wrong:', w)
w = w + 1
# time.sleep(10)
# try:
# allEvent().installUpload(i, ip, appkey)
# # allEvent().formevent(i, ip, appkey)
#
# except Exception:
# print('install_wrong:', w)
# w = w + 1
# time.sleep(3)
# try:
# allEvent().adshow(i, ip, appkey,adid)
......
......@@ -91,51 +91,51 @@ class allEvent:
# 3.download + deviceId有归因结果asa_install_type = old_download对应1
# 4.download + deviceId无归因结果asa_install_type = new_download对应2
# # 转化类型,新增或重装,Download 或 Redownload
"iad-conversion-type": "Download",
# 广告活动组ID(campaign group id)
"iad-org-id": "111111",
# 广告活动组名称(campaign group name)
"iad-org-name": "name",
# 广告活动ID
"iad-campaign-id": "111",
# 广告活动名称
"iad-campaign-name": "CampaignName",
# 广告组ID
"iad-adgroup-id": "111111",
# 广告组名称
"iad-adgroup-name": "AdGroupName",
# 关键词 id
"iad-keyword-id": "111",
# 关键词
"iad-keyword": "Keyword",
# 素材ID
"iad-creativeset-id": "111",
# 素材名称
"iad-creativeset-name": "CreativeSetName",
# 点击ASA广告时间
"iad-click-date": '2021-06-24T11:32:33Z',
# 本次下载完成的时间(仅ASA转化时,该值传且必传)
"iad-conversion-date": when,
# Broad 广泛匹配 ; Exact 完全匹配;SearchMatch 搜索匹配
# 关键词匹配类型
"iad-keyword-matchtype": "SearchMatch",
#首次下载完成的时间(有可能包括非ASA转化,当为redownload且conversion date有值时,purchase date是第一次下载App的时间)
"iad-purchase-date": '2021-06-24T11:32:33Z',
# 归因结果
"iad-attribution": "true",
# 国家
"iad-country-or-region": "US",
'asa_install_time':'2021-06-24T11:32:33Z',
# "iad-conversion-type": "Download",
#
# # 广告活动组ID(campaign group id)
# "iad-org-id": "432432432",
# # 广告活动组名称(campaign group name)
# "iad-org-name": "name",
#
# # 广告活动ID
# "iad-campaign-id": "111",
# # 广告活动名称
# "iad-campaign-name": "CampaignName",
#
#
# # 广告组ID
# "iad-adgroup-id": "111111",
# # 广告组名称
# "iad-adgroup-name": "AdGroupName",
#
#
# # 关键词 id
# "iad-keyword-id": "111",
# # 关键词
# "iad-keyword": "Keyword",
#
#
# # 素材ID
# "iad-creativeset-id": "111",
# # 素材名称
# "iad-creativeset-name": "CreativeSetName",
#
# # 点击ASA广告时间
# "iad-click-date": '2021-06-24T11:32:33Z',
# # 本次下载完成的时间(仅ASA转化时,该值传且必传)
# "iad-conversion-date": when,
#
# # Broad 广泛匹配 ; Exact 完全匹配;SearchMatch 搜索匹配
# # 关键词匹配类型
# "iad-keyword-matchtype": "SearchMatch",
# #首次下载完成的时间(有可能包括非ASA转化,当为redownload且conversion date有值时,purchase date是第一次下载App的时间)
# "iad-purchase-date": '2021-06-24T11:32:33Z',
# # 归因结果
# "iad-attribution": "true",
# # 国家
# "iad-country-or-region": "US",
# 'asa_install_time':'2021-06-24T11:32:33Z',
......
......@@ -6,7 +6,7 @@ import string
import time
#iOS常规渠道激活
appkey = 'cd9a88d26f715c3a0503dd9a1476cccd'
appkey = '16dc0cb882d3dbec4f7f66251a84d6dd'
event = 'event_1'
for index in range(1):
......@@ -17,8 +17,8 @@ for index in range(1):
d = "".join(random.sample(string.ascii_letters + string.digits, 4))
e = "".join(random.sample(string.ascii_letters + string.digits, 12))
i = (a + "-" + b + "-" + c + "-" + d + "-" + e).upper()
# i = 'R8DUK9OE-8QBE-W8YJ-TFP1-A6W3KZEVGYU2'
# i = (a + "-" + b + "-" + c + "-" + d + "-" + e).upper()
i = 'NDHAFTRN-LUAS-89ER-ABI2-YYU0NQEOXESD'
print(i)
adid = ''.join(str(random.choice(range(10))) for _ in range(12))
# 随机生成ip
......
from microservices import redirectios
from microservices import receiveios
import string
import random
import socket
import struct
import hashlib
import time
ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# md5加密
def computeMD5(message):
m = hashlib.md5()
m.update(message.encode(encoding='utf-8'))
return m.hexdigest()
# md5加密
def computeMD5upper(message):
m = hashlib.md5()
m.update(message.encode(encoding='utf-8'))
return m.hexdigest().upper()
def idfacode():
ret = ''
a = "".join(random.sample(string.ascii_letters+string.digits, 8))
b = "".join(random.sample(string.ascii_letters+string.digits, 4))
c = "".join(random.sample(string.ascii_letters+string.digits, 4))
d = "".join(random.sample(string.ascii_letters+string.digits, 4))
e = "".join(random.sample(string.ascii_letters+string.digits, 12))
i = (a+"-"+b+"-"+c+"-"+d+"-"+e).upper()
ret += i
return ret
def idfvcode():
ret = ''
a = "".join(random.sample(string.ascii_letters+string.digits, 8))
b = "".join(random.sample(string.ascii_letters+string.digits, 4))
c = "".join(random.sample(string.ascii_letters+string.digits, 4))
d = "".join(random.sample(string.ascii_letters+string.digits, 4))
e = "".join(random.sample(string.ascii_letters+string.digits, 12))
i = (a+"-"+b+"-"+c+"-"+d+"-"+e).upper()
ret += i
return ret
# ------------------------点击的取值顺序-----------------
# idfa正常值,idfv为正常值;idfa_md5正常值,idfv_md5为正常值,deviceid取idfa,deviceid md5取idfa_md5
def test_atb1():
i = idfacode()
v = idfvcode()
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = computeMD5(i)
redirectios.parms['idfv'] = v
redirectios.parms['idfv_md5'] = computeMD5(v)
redirectios.parms['ipv4'] = ip
redirectios.send_request3('mURv22a', '')
print(i)
# idfa>ipv4
# idfa为空,idfv为正常值;idfa_md5为空,idfv_md5为正常值,deviceid取ip
def test_atb2():
i = idfacode()
v = idfvcode()
redirectios.parms['idfa'] = ''
redirectios.parms['idfa_md5'] = ''
redirectios.parms['idfv'] = v
redirectios.parms['idfv_md5'] = computeMD5(v)
redirectios.parms['ipv4'] = ip
redirectios.send_request3('mURv22a', '')
print(i)
# ------------------------精准归因-----------------
# idfa正常值,idfv为正常值;idfa_md5正常值,idfv_md5为正常值,归因结果为idfa
def test_atb3():
i = idfacode()
v = idfvcode()
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = computeMD5(i)
redirectios.send_request3('mURv22a','')
time.sleep(8)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.send_request()
print(i)
# idfa点击为小写,iafa激活为大写,无归因
def test_atb4():
i = idfacode()
v = idfvcode()
redirectios.parms['idfa'] = i.lower()
redirectios.parms['idfa_md5'] = ''
redirectios.send_request3('mURv22a','')
time.sleep(8)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = ''
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = ''
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = ''
receiveios.send_request()
print(i)
# idfa点击为大写,idfa激活为小写,无归因
def test_atb5():
i = idfacode()
v = idfvcode()
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = ''
redirectios.send_request3('mURv22a', '')
time.sleep(8)
receiveios.data[0]['device_info']['idfa'] = i.lower()
receiveios.data[0]['device_info']['idfa_md5'] = ''
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i.lower()
receiveios.data[0]['device_info']['device_id_md5'] = ''
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = ''
receiveios.send_request()
print(i.lower())
# 激活中的idfa_md5与点击中的idfa_md5一致,点击中idfa正常,激活中idfa为空,归因结果为idfa_md5
def test_atb6():
i = idfacode()
v = idfvcode()
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = computeMD5(i)
redirectios.send_request3('mURv22a','')
time.sleep(8)
receiveios.data[0]['device_info']['idfa'] = ''
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = v
receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['device_id_type'] = 'idfv'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.send_request()
print(v)
# 激活中的idfa_md5与点击中的idfa_md5大小写不一致,点击中idfa_md5为小写,激活中idfa_md5为大写,不归因
def test_atb7():
i = idfacode()
v = idfvcode()
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = computeMD5(i)
redirectios.send_request3('mURv22a','')
time.sleep(8)
receiveios.data[0]['device_info']['idfa'] = ''
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5upper(i)
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = v
receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['device_id_type'] = 'idfv'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.send_request()
print(v)
# 激活中的idfa_md5与点击中的idfa_md5大小写不一致,点击中idfa_md5为大写,激活中idfa_md5为小写,不归因
def test_atb8():
i = idfacode()
v = idfvcode()
redirectios.parms['idfa'] = i
redirectios.parms['idfa_md5'] = computeMD5upper(i)
redirectios.send_request3('mURv22a','')
time.sleep(8)
receiveios.data[0]['device_info']['idfa'] = ''
receiveios.data[0]['device_info']['idfa_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = v
receiveios.data[0]['device_info']['device_id_md5'] = computeMD5(i)
receiveios.data[0]['device_info']['device_id_type'] = 'idfv'
receiveios.data[0]['device_info']['device_id_md5_type'] = 'idfa_md5'
receiveios.send_request()
print(v)
print(computeMD5(i))
# idfa点击为小写,iafa激活为大写,idfa_md5点击有值,激活无值,实时侧添加md5加密值,归因方式为md5
def test_atb9():
i = idfacode()
v = idfvcode()
redirectios.parms['idfa'] = i.lower()
redirectios.parms['idfa_md5'] = computeMD5(i)
redirectios.send_request3('mURv22a','')
time.sleep(8)
receiveios.data[0]['device_info']['idfa'] = i
receiveios.data[0]['device_info']['idfa_md5'] = ''
receiveios.data[0]['device_info']['idfv'] = v
receiveios.data[0]['device_info']['idfv_md5'] = computeMD5(v)
receiveios.data[0]['device_info']['device_id'] = i
receiveios.data[0]['device_info']['device_id_md5'] = ''
receiveios.data[0]['device_info']['device_id_type'] = 'idfa'
receiveios.data[0]['device_info']['device_id_md5_type'] = ''
receiveios.send_request()
print(i)
\ No newline at end of file
import requests
import json
import pytest
import time
url = "http://tkiomicro-receive-788931749.cn-north-1.elb.amazonaws.com.cn/receive/tkiov2/sdk"
chaochang = '543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131232132132543214223221321321312131313133132131232131232132132'
......@@ -13,16 +14,16 @@ global data
data = [
{
"application_info": {
"appkey": "74b81be2432c029040e0b2bc375ce7fb",
"appkey": "22e7d9a67fd54ecb5b298ab7fbb1fb7c",
"bundleid": "3423232",
"app_version": "1.9.0",
"channel_name": "default"
},
"timestamp_info": {
"time_zone": "GMT+08",
"install_time": "1637823377000",
"current_event_time": "1637823377000",
"report_time": "1637823377000"
"install_time": int(round(time.time() * 1000)),
"current_event_time": int(round(time.time() * 1000)),
"report_time": int(round(time.time() * 1000)),
},
"collector_info": {
"integration_type": "sdk",
......@@ -83,6 +84,7 @@ data_temp = json.dumps(data)
def send_request():
global data
url = "http://tkiomicro-receive-788931749.cn-north-1.elb.amazonaws.com.cn/receive/tkiov2/sdk"
data[0]['timestamp_info']['install_time'] = int(round(time.time() * 1000))
# print(data)
response = requests.request("POST", url, headers=headers, data=json.dumps(data))
print(response.text)
......
......@@ -30,21 +30,21 @@ parms = {
# 用户代理信息。限制512字符内。is_s2s=1时都必传,0时都选传,0时优先取传参UA,未传参或报错时,取http header中的user agent作为ua的值
'ua': 'Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36',
# Android OAID原值。限制512字符内。Android选传,app_platform=ios时报错
'oaid': '3DEA635F-B24F-434B-833F-4ED028FEAEEF',
'oaid': '',
# Android OAID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'oaid_md5': '8e488a40a17aed2f6752f51382a4eafc',
'oaid_md5': '',
# Android主卡IMEI原值。限制32字符内。Android选传,app_platform=ios时报错
'imei1': '8342732742383',
'imei1': '',
# Android主卡IMEI原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'imei1_md5': '8e488a40a17aed2f6752f51382a4eafc',
'imei1_md5': '',
# Android副卡IMEI原值。限制32字符内。Android选传,app_platform=ios时报错
'imei2': '8342732742383',
'imei2': '',
# Android副卡IMEI原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'imei2_md5': '8e488a40a17aed2f6752f51382a4eafc',
'imei2_md5': '',
# Google Advertising ID原值。固定36字符。Android选传,app_platform=ios时报错
'gaid': 'B21C5EC5-9921-42FD-AAC5-07A0EB6CF1A0',
'gaid': '',
# Google Advertising ID原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
'gaid_md5': '8e488a40a17aed2f6752f51382a4eafc',
'gaid_md5': '',
# //MAC原值。固定17字符。Android选传,app_platform=ios时报错
'mac': '',
# MAC原值MD5后转小写。固定为32字符。Android选传,app_platform=ios时报错
......@@ -112,7 +112,6 @@ data_temp = json.dumps(parms)
def send_request(dl, cs):
global parms
url1 = 'http://tmtest.trackingio.com/receive/turl/' + dl + cs
parms['ts'] = int(round(time.time() * 1000))
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url)
print(response.text)
......@@ -130,6 +129,16 @@ def send_request2(dl, cs):
# response = json.loads(response.text)
return response
def send_request3(dl, cs):
global parms
url1 = 'http://tmtest.trackingio.com/receive/turl/' + dl + cs
parms['ts'] = int(round(time.time() * 1000))
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url)
print(response.text)
parms = json.loads(data_temp)
response = json.loads(response.text)
return response
# 短链错误
def test_dl():
......@@ -138,28 +147,33 @@ def test_dl():
# 触点传参时间为正常
def test_ts1():
def test_ts9():
parms['ts'] = current_time_13
re = send_request('Yzuiuma', '')
assert re["status"] == 0
# 触点传参时间超过13字符
def test_ts2():
parms['ts'] = '16462909436611'
def test_ts8():
parms['ts'] = '16462909436611321'
re = send_request('Yzuiuma', '')
assert re["status"] == 167
# 触点传参时间等于13字符,但是包含特殊字符
def test_ts3():
def test_ts7():
parms['ts'] = '1@46290943661'
re = send_request('Yzuiuma', '')
assert re["status"] == 167
# 触点传参时间等于13字符,但是包含汉子
def test_ts0():
parms['ts'] = '1测4690943661'
re = send_request('Yzuiuma', '')
assert re["status"] == 167
# iss2s=1,ts为空
def test_ts3():
def test_ts6():
parms['ts'] = ""
parms['is_s2s'] = "1"
re = send_request('Yzuiuma', '')
......@@ -167,7 +181,7 @@ def test_ts3():
# iss2s=0,ts为空,跳转至监测链接的landing_page_url地址
def test_ts4():
def test_ts5():
parms['ts'] = ""
parms['is_s2s'] = "0"
send_request2('Yzuiuma', '')
......
......@@ -14,7 +14,7 @@ global parms
parms = {
# 触点传参时间。is_s2s=1时必传,0时选传。不同渠道有可能传多种格式,详见需求。限制32位字符内。短链传参。
'ts': '2122132121',
'ts': int(round(time.time() * 1000)),
# 集成方式。is_s2s=1为服务器上报触点,0为客户端上报触点。0或1时有不同的参数非空校验,详见需求。固定为0或1。都必传
'is_s2s': '1',
# 操作系统。限制16字符内。都选传。短链传参。暂不与app_platform互相做校验。
......@@ -24,14 +24,14 @@ parms = {
# 用户公网IP v4版本。限制15字符内。is_s2s=1时都必传,0时都选传,0时优先取传参IP,未传参或传参报错时,取http header中的ip作为ipv4的值
'ipv4': '1.1.1.1',
# 用户公网IP v6版本。限制128字符内。都选传
'ipv6': '1.1.1.1',
'ipv6': '',
# 用户代理信息。限制512字符内。is_s2s=1时都必传,0时都选传,0时优先取传参UA,未传参或报错时,取http header中的user agent作为ua的值
'ua': 'Mozilla/5.0 (Linux; U; Android 7.0; zh-cn; Nexus 5X Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko)Version/4.0 Chrome/37.0.0.0 MQQBrowser/7.3 Mobile Safari/537.36',
# iOS IDFA原值。固定为36字符
"idfa": "3DEA635F-B24F-434B-833F-4ED028FEAEEF",
"idfa_md5": "8e488a40a17aed2f6752f51382a4eafc",
"idfv": "3DEA635F-B24F-434B-833F-4ED028FEAEEF",
"idfv_md5": "8e488a40a17aed2f6752f51382a4eafc",
"idfa": "",
"idfa_md5": "",
"idfv": "",
"idfv_md5": "",
# 触点类型。固定为click。都必传
'touchpoint_type': 'click',
# 归因类型。固定为ua(user acquirement新客获取)
......@@ -90,10 +90,24 @@ def send_request(dl, cs):
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url)
parms = json.loads(data_temp)
response = json.loads(response.text)
return response
def send_request3(dl, cs):
global parms
url1 = 'http://tmtest.trackingio.com/receive/turl/' + dl + cs
parms['ts'] = int(round(time.time() * 1000))
response = requests.get(url=url1, params=parms, timeout=10, verify=False)
print(response.url)
print(response.text)
parms = json.loads(data_temp)
response = json.loads(response.text)
return response
# idfa为空
def test_idfa1():
parms['idfa'] = ''
......
......@@ -7,7 +7,7 @@ appkey = '9f6dfeed6a42210a781bafb7e62dc722'
cid = '11469'
#surl
surl = 'Evmu6na'
for _ in range(1):
for _ in range(50):
# 随机生成12为数组
i = ''.join(str(random.choice(range(10))) for _ in range(12))
# i = '324014210339'
......@@ -17,6 +17,6 @@ for _ in range(1):
#打开
allEvent().openxiaochengxu(i,ip,cid,surl,appkey)
#pv
allEvent().pviaochengxu(i,ip,cid,surl,appkey)
#离开
# allEvent().pviaochengxu(i,ip,cid,surl,appkey)
# #离开
# allEvent().hidechengxu(i,ip,cid,surl,appkey)
import turtle as t
++ /dev/null
import turtle as t
import math
# 取消绘图过程
#t.tracer(0)
#设置速度
t.speed(0)#速度
t.delay(10)#延迟
#turtle.tracer(False)
#双耳
#左耳
t.penup()
t.goto(-150,200)
t.setheading(160)
t.begin_fill()
t.pendown()
t.circle(-30,230)
t.setheading(180)
t.circle(37,90)
t.end_fill()
#右耳
t.penup()
t.goto(60,200)
t.setheading(20)
t.begin_fill()
t.pendown()
t.circle(30,230)
t.setheading(0)
t.circle(-37,90)
t.end_fill()
#头
t.pensize(5)
t.penup()
t.goto(-113,237)
t.setheading(30)
t.pendown()
t.circle(-134,60)
t.penup()
t.goto(-150,200)
t.setheading(-120)
t.pendown()
t.circle(200,80)
t.penup()
t.goto(60,200)
t.setheading(-60)
t.pendown()
t.circle(-200,80)
t.penup()
t.setheading(210)
t.pendown()
t.circle(-120,60)
#双眼
#左眼
#眼圈
t.penup()
t.goto(-140,100)
t.setheading(-45)
t.begin_fill()
t.pendown()
a = 0.2
for i in range(120):
if 0<=i<30 or 60<=i<90:
a=a+0.1
t.lt(3) #向左转3度
t.fd(a) #向前走a的步长
else:
a=a-0.1
t.lt(3)
t.fd(a)
t.end_fill()
#眼白
t.fillcolor("white")
t.penup()
t.goto(-103,125)
t.setheading(0)
t.begin_fill()
t.pendown()
t.circle(13,360)
t.end_fill()
#眼珠
t.fillcolor("sienna")
t.pencolor("sienna")
t.penup()
t.goto(-102,133)
t.setheading(0)
t.begin_fill()
t.pendown()
t.circle(5,360)
t.end_fill()
#右眼
#眼圈
t.penup()
t.goto(50,100)
t.setheading(45)
t.fillcolor("black")
t.pencolor("black")
t.begin_fill()
t.pendown()
a = 0.2
for i in range(120):
if 0<=i<30 or 60<=i<90:
a=a+0.1
t.lt(3) #向左转3度
t.fd(a) #向前走a的步长
else:
a=a-0.1
t.lt(3)
t.fd(a)
t.end_fill()
#眼白
t.fillcolor("white")
t.penup()
t.goto(13,125)
t.setheading(0)
t.begin_fill()
t.pendown()
t.circle(13,360)
t.end_fill()
#眼珠
t.fillcolor("sienna")
t.pencolor("sienna")
t.penup()
t.goto(12,133)
t.setheading(0)
t.begin_fill()
t.pendown()
t.circle(5,360)
t.end_fill()
#鼻子
t.pencolor("black")
t.fillcolor("black")
t.penup()
t.goto(-55,133)
t.begin_fill()
t.pendown()
t.fd(20)
t.seth(-120)
t.fd(20)
t.seth(120)
t.fd(20)
t.end_fill()
#嘴
t.penup()
t.goto(-70,110)
t.setheading(-30)
t.fillcolor("red")
t.begin_fill()
t.pendown()
t.circle(50,60)
t.setheading(-120)
t.circle(-100,15)
t.circle(-15,90)
t.circle(-100,15)
t.end_fill()
#四肢
#左臂
t.penup()
t.goto(-175,100)
t.fillcolor("black")
t.begin_fill()
t.setheading(-120)
t.pendown()
t.fd(100)
t.setheading(-110)
t.circle(20,180)
t.fd(30)
t.circle(-5,160)
t.end_fill()
#右臂
t.penup()
t.goto(85,100)
t.setheading(60)
t.begin_fill()
t.pendown()
t.fd(100)
t.setheading(70)
t.circle(20,180)
t.fd(30)
t.circle(-5,160)
t.end_fill()
#小红心
t.penup()
t.pencolor("red")
t.fillcolor('red')
t.goto(105,200)
t.begin_fill()
t.pendown()
t.circle(-5,180)
t.setheading(90)
t.circle(-5,180)
t.setheading(-120)
t.fd(17)
t.penup()
t.goto(105,200)
t.pendown()
t.setheading(-60)
t.fd(17)
t.end_fill()
t.pencolor("black")
t.fillcolor("black")
#左腿
t.penup()
t.goto(-120,-45)
t.begin_fill()
t.pendown()
t.setheading(-90)
t.circle(-140,20)
t.circle(5,109)
t.fd(30)
t.circle(10,120)
t.setheading(90)
t.circle(-140,10)
t.end_fill()
#右腿
t.penup()
t.goto(30,-45)
t.begin_fill()
t.pendown()
t.setheading(-90)
t.circle(140,20)
t.circle(-5,109)
t.fd(30)
t.circle(-10,120)
t.setheading(90)
t.circle(140,10)
t.end_fill()
#冰糖外壳
t.pensize(1)
t.penup()
t.goto(-160,195)
t.setheading(160)
t.pendown()
t.circle(-40,230)
t.setheading(30)
t.circle(-134,58)
t.setheading(60)
t.circle(-40,215)
t.setheading(-60)
t.fd(15)
t.circle(2,200)
t.setheading(65)
t.fd(30)
t.circle(-25,180)
t.fd(100)
t.circle(2,25)
t.circle(-200,47)
t.circle(2,60)
t.circle(140,23)
t.circle(-2,90)
t.setheading(180)
t.fd(70)
t.circle(-2,90)
t.fd(30)
t.setheading(-160)
t.circle(-100,35)
t.setheading(-90)
t.fd(30)
t.circle(-2,90)
t.fd(70)
t.circle(-2,90)
t.setheading(60)
t.circle(140,30)
t.circle(2,45)
t.circle(-200,19)
t.circle(2,130)
t.fd(30)
t.circle(-25,180)
t.fd(100)
t.setheading(90)
t.circle(-200,30)
#冰糖面罩
t.pensize(3)
t.penup()
t.goto(65,120)
t.setheading(90)
t.pendown()
t.pencolor("red")
a = 1
for i in range(120):
if 0<=i<30 or 60<=i<90: #控制a的变化
a=a+0.25
t.lt(3) #向左转3度
t.fd(a) #向前走a的步长
else:
a=a-0.25
t.lt(3)
t.fd(a)
t.pencolor("orange")
t.penup()
t.goto(66,120)
t.pendown()
a = 1
for i in range(120):
if 0<=i<30 or 60<=i<90:
a = a + 0.255
t.lt(3)
t.fd(a)
else:
a = a - 0.255
t.lt(3)
t.fd(a)
t.pencolor("green")
t.penup()
t.goto(67,120)
t.pendown()
a = 1
for i in range(120):
if 0<=i<30 or 60<=i<90:
a = a + 0.2555
t.lt(3)
t.fd(a)
else:
a = a - 0.2555
t.lt(3)
t.fd(a)
t.pencolor("deep sky blue")
t.penup()
t.goto(68,120)
t.pendown()
a = 1
for i in range(120):
if 0<=i<30 or 60<=i<90:
a = a + 0.25955
t.lt(3)
t.fd(a)
else:
a = a - 0.25955
t.lt(3)
t.fd(a)
t.pencolor("pink")
t.penup()
t.goto(71,120)
t.pendown()
a = 1
for i in range(120):
if 0<=i<30 or 60<=i<90:
a = a + 0.26
t.lt(3)
t.fd(a)
else:
a = a - 0.26
t.lt(3)
t.fd(a)
t.pencolor("purple")
t.penup()
t.goto(72,120)
t.pendown()
a = 1
for i in range(120):
if 0<=i<30 or 60<=i<90:
a = a + 0.269
t.lt(3)
t.fd(a)
else:
a = a - 0.269
t.lt(3)
t.fd(a)
###五环
##t.penup()
##t.goto(-55,-10)
##t.pendown()
##t.pencolor("blue")
##t.circle(10)
##t.penup()
##t.goto(-40,-10)
##t.pendown()
##t.pencolor("black")
##t.circle(10)
##t.penup()
##t.goto(-25,-10)
##t.pendown()
##t.pencolor("red")
##t.circle(10)
##t.penup()
##t.goto(-50,-20)
##t.pendown()
##t.pencolor("yellow")
##t.circle(10)
##t.penup()
##t.goto(-30,-20)
##t.pendown()
##t.pencolor("green")
##t.circle(10)
# 直接贴图片
# t.register_shape("北京.gif") # 注册形状
t1 = t.Turtle()
# t1.shape("北京.gif")
t1.penup()
t1.goto(-45,-10)
#t.update()
t.done()
......@@ -26,7 +26,7 @@ class allEvent:
print("dp返回:" + p.text)
# print("状态码:"+p.status_code)
print("设备id:" + i)
# print(p.url)
print(p.url)
except Exception as err:
print(err)
......
......@@ -15,5 +15,3 @@ import time
# allEvent().dp_imei(i, appkey)
# # allEvent().dp_ios(i, appkey)
current_time_13 = int(round(time.time() * 1000))
print(current_time_13)
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