Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InterfaceAutoTest
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
TestAuto
InterfaceAutoTest
Commits
6cad7b63
Commit
6cad7b63
authored
May 18, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决修改头像用例报错
parent
91e50021
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
common/db.py
+5
-1
test_case/bmc/test_ ElectronicLicense.py
+15
-3
test_case_data/bmc/bmc_tk.xlsx
+0
-0
No files found.
common/db.py
View file @
6cad7b63
...
...
@@ -17,6 +17,9 @@ class RedisString(RedisBase):
"""获取值"""
result
=
self
.
r
.
get
(
xx
)
return
result
def
delete_key
(
self
,
xxx
):
self
.
r
.
delete
(
*
self
.
r
.
keys
(
f
'{xxx}*'
))
# mysql类
...
...
@@ -84,6 +87,7 @@ if __name__ == '__main__':
# r = RedisString(0).get('edl:sms_value:17822000010:MOBILE_REGISTER')
# print(r)
# print(str(r)[-7:-1])
pass
# pass
RedisString
(
0
)
.
delete_key
(
"bmc:c1:dl_img:uid"
)
test_case/bmc/test_ ElectronicLicense.py
View file @
6cad7b63
...
...
@@ -10,7 +10,7 @@ from service.login import BMY
from
common.tools
import
request_main
from
config
import
BaseConfig
,
BMCConfig
from
service.login
import
BMC
from
common.db
import
RedisString
from
common.db
import
RedisString
,
MYSQL
"""环境初始化和清除"""
# 1.headers获取
...
...
@@ -34,7 +34,19 @@ def get_vehickleId_Tounbind():
vehicleId
=
dic
[
'vehicleId'
]
return
vehicleId
@pytest.fixture
(
scope
=
'function'
)
def
avatarUpdate_del
()
:
#修改头像清除
mysql
=
MYSQL
(
host
=
"10.197.236.190"
,
port
=
3306
,
user
=
"root"
,
pwd
=
"123456"
,
db
=
"edl_private"
)
mysql
.
ExecuNonQuery
(
"DELETE FROM edl_private.driving_license_image_audit WHERE name='自动化';"
)
# 删除驾驶员
RedisString
(
0
)
.
delete_key
(
"bmc:c1:dl_img:uid"
)
yield
@pytest.fixture
(
scope
=
'function'
)
def
imaAuditStatus
():
# 查看照片审核状态
payload
=
{
"bNetTag"
:
"trf_mgt"
,
"avatarUrl"
:
"
\
/group1
\
/M00
\
/00
\
/11
\
/CsXswmCTvF-AOPy1AABzUjaImN072.JPEG"
,
"bCityCode"
:
"520100"
}
res
=
requests
.
post
(
f
"{BMCConfig().host}/drivingLicense/avatar/update"
,
json
=
payload
,
headers
=
headers
)
...
...
@@ -74,7 +86,7 @@ class TestDrivingLicense():
"""断言"""
assert
res
[
'code'
]
==
expectData
[
'code'
]
@pytest.mark.usefixtures
(
"imaAuditStatus"
)
@allure.story
(
"照片审核状态"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/22759"
)
@allure.description
(
"/drivingLicense/image/audit/status"
)
...
...
@@ -107,7 +119,7 @@ class TestDrivingLicense():
"""断言"""
assert
res
[
'code'
]
==
expectData
[
'code'
]
@pytest.mark.
scoreDetail
@pytest.mark.
usefixtures
(
"avatarUpdate_del"
)
@allure.story
(
"修改驾驶证头像"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/22750"
)
@allure.description
(
"/drivingLicense/avatar/update"
)
...
...
test_case_data/bmc/bmc_tk.xlsx
View file @
6cad7b63
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