Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
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
Bozhong钟波
interface
Commits
9a0d71bc
Commit
9a0d71bc
authored
Sep 26, 2023
by
“xbozhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加节点
parent
ed2844f9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
handle_db.py
Common/handle_db.py
+1
-1
test_talented_Person.py
TestCases/test_talented_Person.py
+7
-9
接口业务流.xlsx
TestDatas/接口业务流.xlsx
+0
-0
No files found.
Common/handle_db.py
View file @
9a0d71bc
...
...
@@ -49,7 +49,7 @@ class HandleDB:
# 第三步 执行sql语句
return
self
.
cur
.
execute
(
sql
)
def
update
(
self
):
def
update
(
self
,
sql
):
# 执行增、删、改操作
self
.
cur
.
execute
(
sql
)
self
.
conn
.
commit
()
...
...
TestCases/test_talented_Person.py
View file @
9a0d71bc
...
...
@@ -37,18 +37,11 @@ class TestTalentedPerson:
# 关闭excel
exc
.
close_file
()
print
(
cases
)
# # 如果存在distribution变量,说明该订单被分配了,需要跳过分配客户接口
# if hasattr(EnvData, "distribution"):
# del cases[12:15]
@
pytest
.
mark
.
parametrize
(
"case"
,
cases
)
def
test_talented_person
(
self
,
case
,
get_newPhone
):
logger
.
info
(
"********** 执行用例{}:{} **********"
.
format
(
case
[
"id"
],
case
[
"title"
]))
# 第二步,替换request_data中的未知数
case
=
replace_case_by_regular
(
case
)
# print(case)
# 第三步,执行请求
if
hasattr
(
EnvData
,
"token"
):
...
...
@@ -61,7 +54,7 @@ class TestTalentedPerson:
response
=
send_request
(
case
[
"method"
],
case
[
"url"
],
dic
,
token
=
getattr
(
EnvData
,
"token"
),
Authorization
=
getattr
(
EnvData
,
"client_token"
))
time
.
sleep
(
90
)
elif
case
[
"
title"
]
==
"提交
"
:
elif
case
[
"
check_keyword"
]
==
"Authorized
"
:
response
=
send_request
(
case
[
"method"
],
case
[
"url"
],
case
[
"request_data"
],
token
=
getattr
(
EnvData
,
"token"
),
Authorization
=
getattr
(
EnvData
,
"client_token"
))
...
...
@@ -85,8 +78,13 @@ class TestTalentedPerson:
id_list
=
[]
for
i
in
ids
:
id_list
.
append
(
i
[
"id"
])
print
(
id_list
)
setattr
(
EnvData
,
"id_list"
,
id_list
)
elif
case
[
"check_sql"
]
and
case
[
"check_keyword"
]
==
"file_id"
:
list_id
=
get_newPhone
.
select_all_data
(
case
[
"check_sql"
])
file_id
=
list_id
[
0
][
"id"
]
setattr
(
EnvData
,
"file_id"
,
file_id
)
elif
case
[
"check_sql"
]
and
case
[
"check_keyword"
]
==
"Authorized"
:
get_newPhone
.
update
(
case
[
"check_sql"
])
# 第五步,断言
assert
response
.
json
()[
"code"
]
==
200
TestDatas/接口业务流.xlsx
View file @
9a0d71bc
No preview for this file type
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