Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
API-Automation
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
文鑫
API-Automation
Commits
3dbd2714
Commit
3dbd2714
authored
Jul 01, 2020
by
文鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改feature为数据源
parent
05746732
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
test_DataA.py
+4
-1
No files found.
test_DataA.py
View file @
3dbd2714
...
...
@@ -7,20 +7,23 @@ import pytest
from
common
import
getSourceId
from
common.getData
import
DoExcelByPandas
@allure.feature
(
'
系统设置
'
)
@allure.feature
(
'
数据源
'
)
class
TestSystem
():
parametrize
=
DoExcelByPandas
()
.
get_data_for_pytest
(
'./data/data.xlsx'
,
'Sheet1'
)
@allure.title
(
'{story}'
)
@pytest.mark.parametrize
(
'id,url,data,story,method,severity,condition,except_result'
,
parametrize
)
def
test
(
self
,
id
,
url
,
data
,
story
,
method
,
severity
,
condition
,
except_result
):
# test开头的测试函数
url
=
url
#测试删除数据源接口
if
story
==
'删除mysql数据源'
or
story
==
'删除oracle数据源'
:
id
=
getSourceId
.
get_SourceId
(
data
)
url
=
url
+
id
r
=
requests
.
post
(
url
=
url
)
#测试post接口
elif
method
==
'post'
:
json
=
eval
(
data
)
r
=
requests
.
post
(
url
=
url
,
json
=
json
)
#测试get接口
elif
method
==
'get'
:
r
=
requests
.
get
(
url
=
url
)
response
=
r
.
json
()
...
...
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