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
21bcd882
Commit
21bcd882
authored
4 years ago
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add payment enevt
parent
153ffcb9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
4 deletions
+52
-4
misc.xml
.idea/misc.xml
+0
-4
workspace.xml
.idea/workspace.xml
+0
-0
randomUtil.py
common/randomUtil.py
+4
-0
params.py
config/prod/params.py
+26
-0
test_pay.py
testcase/android_events/test_pay.py
+22
-0
No files found.
.idea/misc.xml
View file @
21bcd882
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.6.4 (/anaconda3/bin/python3.6)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.6.4 (/anaconda3/bin/python3.6)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"SvnConfiguration"
>
<configuration
/>
</component>
</project>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.idea/workspace.xml
View file @
21bcd882
This diff is collapsed.
Click to expand it.
common/randomUtil.py
View file @
21bcd882
...
@@ -21,4 +21,7 @@ class randomUtil:
...
@@ -21,4 +21,7 @@ class randomUtil:
i
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
i
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
12
))
return
i
return
i
def
transactionid
(
self
):
t
=
''
.
join
(
str
(
random
.
choice
(
range
(
10
)))
for
_
in
range
(
19
))
return
t
r
=
randomUtil
()
r
=
randomUtil
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
config/prod/params.py
View file @
21bcd882
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
"""
"""
import
time
import
time
import
random
from
config.envcfg
import
prod
from
config.envcfg
import
prod
from
common
import
randomUtil
from
common
import
randomUtil
...
@@ -191,3 +192,28 @@ params_register = {
...
@@ -191,3 +192,28 @@ params_register = {
# 'ds': ds,
# 'ds': ds,
'who'
:
'lxx_test'
'who'
:
'lxx_test'
}
}
params_pay
=
{
'what'
:
'payment'
,
'appid'
:
prod
[
'events'
][
'appkey'
],
'context'
:
{
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_imei'
:
randomUtil
.
r
.
randimei
(),
'_androidid'
:
randomUtil
.
r
.
randimei
(),
'_ip'
:
randomUtil
.
r
.
randip
(),
'_timestamp'
:
int
(
round
(
time
.
time
()
*
1000
)),
'_transactionid'
:
randomUtil
.
r
.
transactionid
(),
'_paymenttype'
:
"alipay"
,
'_ryos'
:
"android"
,
'_currencytype'
:
"CNY"
,
'_currencyamount'
:
"10"
,
"_lib_version"
:
"1.5.0"
,
'_oaid'
:
"unknow"
,
# "_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'
}
This diff is collapsed.
Click to expand it.
testcase/android_events/test_pay.py
0 → 100644
View file @
21bcd882
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_pay.py
@time: 2020/8/20 15:43
@desc:
"""
import
unittest
import
json
import
requests
from
config.envcfg
import
prod
,
headers
from
config.prod.params
import
params_pay
class
payTestCase
(
unittest
.
TestCase
):
def
testpayment
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'payment'
,
data
=
json
.
dumps
(
params_pay
),
headers
=
headers
,
timeout
=
5
)
print
(
"付费"
+
r
.
text
)
print
(
prod
[
'events'
][
'url'
]
+
'payment'
)
print
(
json
.
dumps
(
params_pay
))
print
(
r
)
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