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
153ffcb9
Commit
153ffcb9
authored
Aug 20, 2020
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add formate enevt
parent
f707dbab
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
11 deletions
+54
-11
workspace.xml
.idea/workspace.xml
+0
-0
params.py
config/prod/params.py
+32
-11
test_register.py
testcase/android_events/test_register.py
+22
-0
No files found.
.idea/workspace.xml
View file @
153ffcb9
This diff is collapsed.
Click to expand it.
config/prod/params.py
View file @
153ffcb9
...
...
@@ -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
testcase/android_events/test_register.py
0 → 100644
View file @
153ffcb9
# -*- 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
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