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
62e34d38
Commit
62e34d38
authored
4 years ago
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add login enevt
parent
9d8d67a4
master
…
dev2021
No related merge requests found
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
8 deletions
+41
-8
workspace.xml
.idea/workspace.xml
+0
-0
randomUtil.py
common/randomUtil.py
+0
-2
params.py
config/prod/params.py
+22
-6
test_login.py
testcase/android_events/test_login.py
+19
-0
No files found.
.idea/workspace.xml
View file @
62e34d38
This diff is collapsed.
Click to expand it.
common/randomUtil.py
View file @
62e34d38
...
@@ -12,8 +12,6 @@ import random
...
@@ -12,8 +12,6 @@ import random
class
randomUtil
:
class
randomUtil
:
def
__init__
(
self
):
pass
def
randip
(
self
):
def
randip
(
self
):
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
...
...
This diff is collapsed.
Click to expand it.
config/prod/params.py
View file @
62e34d38
...
@@ -10,10 +10,8 @@ import time
...
@@ -10,10 +10,8 @@ import time
from
config.envcfg
import
prod
from
config.envcfg
import
prod
from
common
import
randomUtil
from
common
import
randomUtil
params_install
=
{
params_install
=
{
"what"
:
'install'
,
"what"
:
'install'
,
"appid"
:
prod
[
'events'
][
'appkey'
],
"appid"
:
prod
[
'events'
][
'appkey'
],
"context"
:
{
"context"
:
{
"_carrier"
:
"中国联通"
,
"_carrier"
:
"中国联通"
,
...
@@ -23,7 +21,7 @@ params_install = {
...
@@ -23,7 +21,7 @@ params_install = {
"_pkgname"
:
"com.yanjing.yami"
,
"_pkgname"
:
"com.yanjing.yami"
,
"_campaignid"
:
'default'
,
"_campaignid"
:
'default'
,
"_deviceid"
:
randomUtil
.
r
.
randimei
(),
"_deviceid"
:
randomUtil
.
r
.
randimei
(),
"_imei"
:
"cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1"
,
"_imei"
:
randomUtil
.
r
.
randimei
()
,
# "_idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
# "_idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
# "_androidid": "43214532142142",
# "_androidid": "43214532142142",
# "_imei2":"324323AAAA",
# "_imei2":"324323AAAA",
...
@@ -84,4 +82,22 @@ params_startup = {
...
@@ -84,4 +82,22 @@ params_startup = {
'who'
:
'lxx_test'
'who'
:
'lxx_test'
}
}
print
(
params_install
)
params_login
=
{
\ No newline at end of file
# '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
This diff is collapsed.
Click to expand it.
testcase/android_events/test_login.py
0 → 100644
View file @
62e34d38
# -*- 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
)
This diff is collapsed.
Click to expand it.
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