Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gatling-monitor
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
reyun
gatling-monitor
Commits
536bb60b
Commit
536bb60b
authored
Mar 09, 2022
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c0b220c9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
6 deletions
+36
-6
config.py
config.py
+9
-2
param.py
param.py
+9
-0
testcase.py
testcase.py
+16
-3
title_id.json
title_id.json
+2
-1
No files found.
config.py
View file @
536bb60b
...
...
@@ -5,12 +5,19 @@
# @File : config.py
# @desc :
"""
import
requests
import
pytest
import
param
Headers
=
{
'Authorization'
:
'Bearer 3ba9c1c1-b398-472e-8ae4-b621ba52e283'
,
'Content-Type'
:
'application/json;charset=UTF-8'
}
#
Headers = {'Authorization': 'Bearer 3ba9c1c1-b398-472e-8ae4-b621ba52e283',
#
'Content-Type': 'application/json;charset=UTF-8'}
url_test
=
"http://117.50.4.194"
url_prod
=
"http://gatling.reyun.com"
token_url
=
"http://gatling.reyun.com/api-u/oauth/user/token"
p2v
=
"/api-f/batchIm2Video/asyncBatchImg2V"
v2v
=
"/api-f/video2video/generatedAsync/false"
t2v
=
"/api-f/text2video/asyncGenerated"
param.py
View file @
536bb60b
...
...
@@ -11,6 +11,15 @@ import json
title_id
=
json
.
load
(
open
(
'title_id.json'
,
'r+'
))[
'title_id'
]
+
1
json
.
dump
({
"title_id"
:
title_id
},
open
(
'title_id.json'
,
'w+'
),
sort_keys
=
True
,
indent
=
4
)
token_data
=
json
.
dumps
({
"username"
:
"2@qq.com"
,
"password"
:
"reyun.123"
,
"clientId"
:
"system"
,
"clientSecret"
:
"system"
,
"scope"
:
"app"
,
"grantType"
:
"password"
})
p2v
=
json
.
dumps
({
"sizeId"
:
5
,
"title"
:
title_id
,
...
...
testcase.py
View file @
536bb60b
...
...
@@ -13,18 +13,31 @@ import param
import
config
def
getToken
():
r
=
requests
.
post
(
url
=
config
.
token_url
,
data
=
param
.
token_data
,
headers
=
{
'Content-Type'
:
'application/json;charset=UTF-8'
})
print
(
r
.
json
())
t
=
r
.
json
()[
"data"
][
"access_token"
]
return
t
class
TestGatlingAPI
:
token
=
"Bearer"
+
" "
+
getToken
()
headers
=
{
"authorization"
:
token
,
'Content-Type'
:
'application/json;charset=UTF-8'
}
def
test_p2v
(
self
):
r
=
requests
.
post
(
url
=
config
.
url_prod
+
config
.
p2v
,
data
=
param
.
p2v
,
headers
=
config
.
H
eaders
)
r
=
requests
.
post
(
url
=
config
.
url_prod
+
config
.
p2v
,
data
=
param
.
p2v
,
headers
=
TestGatlingAPI
.
h
eaders
)
print
(
r
.
text
)
assert
r
.
status_code
==
200
def
test_v2v
(
self
):
r
=
requests
.
post
(
url
=
config
.
url_prod
+
config
.
v2v
,
data
=
param
.
v2v
,
headers
=
config
.
H
eaders
)
r
=
requests
.
post
(
url
=
config
.
url_prod
+
config
.
v2v
,
data
=
param
.
v2v
,
headers
=
TestGatlingAPI
.
h
eaders
)
print
(
r
.
text
)
assert
r
.
status_code
==
200
def
test_tv2
(
self
):
r
=
requests
.
post
(
url
=
config
.
url_prod
+
config
.
t2v
,
data
=
param
.
t2v
,
headers
=
config
.
H
eaders
)
r
=
requests
.
post
(
url
=
config
.
url_prod
+
config
.
t2v
,
data
=
param
.
t2v
,
headers
=
TestGatlingAPI
.
h
eaders
)
print
(
r
.
text
)
assert
r
.
status_code
==
200
title_id.json
View file @
536bb60b
{
"title_id"
:
202203
40
"title_id"
:
202203
58
}
\ 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