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
13fde0b6
Commit
13fde0b6
authored
Sep 12, 2020
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
46d95e31
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
11 deletions
+17
-11
workspace.xml
.idea/workspace.xml
+0
-0
envcfg.py
config/envcfg.py
+10
-3
params.py
config/prod/params.py
+2
-2
test_click.py
testcase/android_click/test_click.py
+3
-4
test_install.py
testcase/android_events/test_install.py
+2
-2
No files found.
.idea/workspace.xml
View file @
13fde0b6
This diff is collapsed.
Click to expand it.
config/envcfg.py
View file @
13fde0b6
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: envcfg.py
.py
@file: envcfg.py
@time: 2020/8/6 17:34
@desc:
"""
...
...
@@ -13,10 +13,17 @@ import time
# 测试环境
# 生产环境:
prod_click_url
=
'http://uri6.com/tkio/Er6BFna'
prod_event_url
=
'http://log.trackingio.com'
prod_appkey
=
"895c5256a7f47bd2cca88a29da9e978a"
event_interface
=
{
"events"
:
[
'/receive/tkio/install'
]}
prod
=
{
"click"
:
[
"http://t.uri6.com/tkio/EFbIzya?noredirect=true"
,
"
9b17c1568c3ce34599c5fd2778483ff9
"
],
"click"
:
[
"http://t.uri6.com/tkio/EFbIzya?noredirect=true"
,
"
895c5256a7f47bd2cca88a29da9e978a
"
],
"events"
:
{
"url"
:
"http://
t
log.trackingio.com/receive/tkio/"
,
"url"
:
"http://log.trackingio.com/receive/tkio/"
,
# "url": "http://10.3.20.42:8080",
"interface"
:
"/receive/tkiov2/install"
,
"appkey"
:
"b58f29d64718c6723895cb8a2389258c"
,
...
...
config/prod/params.py
View file @
13fde0b6
...
...
@@ -7,7 +7,7 @@
"""
import
time
from
config.envcfg
import
prod
from
config.envcfg
import
prod
,
prod_appkey
from
common
import
randomUtil
...
...
@@ -56,7 +56,7 @@ params_click = {
params_install
=
{
"what"
:
'install'
,
"appid"
:
prod
[
'events'
][
'appkey'
]
,
"appid"
:
prod
_appkey
,
"context"
:
{
"_carrier"
:
"中国联通"
,
"_network_type"
:
"5G"
,
...
...
testcase/android_click/test_click.py
View file @
13fde0b6
...
...
@@ -7,8 +7,7 @@
"""
import
unittest
from
config.envcfg
import
prod
from
common
import
randomUtil
from
config.envcfg
import
prod_click_url
from
config.prod.params
import
params_click
import
requests
import
os
...
...
@@ -20,8 +19,8 @@ sys.path.append(base_path)
class
clickTestCase
(
unittest
.
TestCase
):
def
testclick
(
self
):
p
=
requests
.
get
(
url
=
prod
[
'click'
][
1
]
,
params
=
params_click
,
timeout
=
30
,
verify
=
False
)
self
.
assertEqual
(
p
.
status_code
,
300
,
msg
=
'接口异常,请检查'
)
p
=
requests
.
get
(
url
=
prod
_click_url
,
params
=
params_click
,
timeout
=
30
,
verify
=
False
)
#
self.assertEqual(p.status_code, 300, msg='接口异常,请检查')
print
(
'执行结果:
\n
================='
)
print
(
p
)
# time.sleep(7)
...
...
testcase/android_events/test_install.py
View file @
13fde0b6
...
...
@@ -8,13 +8,13 @@
import
requests
import
json
import
unittest
from
config.envcfg
import
prod
,
headers
from
config.envcfg
import
prod
_event_url
,
event_interface
,
headers
from
config.prod.params
import
params_install
class
installTestCase
(
unittest
.
TestCase
):
def
testinstall
(
self
):
r
=
requests
.
post
(
url
=
prod
[
"events"
][
"url"
]
+
prod
[
'events'
][
'interface'
],
data
=
json
.
dumps
(
params_install
),
headers
=
headers
)
r
=
requests
.
post
(
url
=
prod
_event_url
+
event_interface
[
"events"
][
0
],
data
=
json
.
dumps
(
params_install
),
headers
=
headers
)
print
(
"
\n
激活事件执行结果:"
+
r
.
text
)
print
(
r
.
url
)
#self.assertEqual(r.status_code, 200, msg="执行失败,请检查")
...
...
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