Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
interfaceTest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
zhaihuitao
interfaceTest
Commits
9a878286
Commit
9a878286
authored
Aug 28, 2020
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c75c84cf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
156 additions
and
5 deletions
+156
-5
workspace.xml
.idea/workspace.xml
+0
-0
envcfg.py
config/envcfg.py
+4
-2
params.py
config/prod/params.py
+106
-0
test_batchUpload.py
testcase/android_events/test_batchUpload.py
+20
-0
test_install.py
testcase/android_events/test_install.py
+3
-3
tokenTest.py
testcase/android_events/tokenTest.py
+23
-0
No files found.
.idea/workspace.xml
View file @
9a878286
This diff is collapsed.
Click to expand it.
config/envcfg.py
View file @
9a878286
...
...
@@ -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"
,
},
}
...
...
config/prod/params.py
View file @
9a878286
...
...
@@ -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
testcase/android_events/test_batchUpload.py
0 → 100644
View file @
9a878286
# -*- 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
)
testcase/android_events/test_install.py
View file @
9a878286
...
...
@@ -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
()
testcase/android_events/tokenTest.py
0 → 100644
View file @
9a878286
# -*- 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment