Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zmops-test
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
sanshi
zmops-test
Commits
743901ad
Commit
743901ad
authored
Nov 26, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备类型
parent
c440e804
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
test_hosttype_get.py
WorkCase/APP/HostType/test_hosttype_get.py
+21
-21
No files found.
WorkCase/APP/HostType/test_hosttype_get.py
View file @
743901ad
...
...
@@ -125,16 +125,17 @@ class TestHostTypeGet(object):
return
sql
@allure.step
(
"校验查询结果"
)
def
check_select
(
self
,
response
,
title
,
parent_id
,
template_ids
,
interfaces
,
description
,
sortid
):
def
check_select
(
self
,
response
):
data
=
UtilsResponse
()
.
get_data
(
response
=
response
)
sql
=
self
.
select_hosttype
(
_id
=
data
)
for
q
,
w
in
enumerate
(
data
[
"list"
][
"records"
]):
sql
=
self
.
select_hosttype
(
_id
=
w
[
"id"
])
for
x
,
y
in
enumerate
(
sql
):
assert
y
.
title
==
title
assert
y
.
parent_id
==
parent_id
assert
y
.
template_ids
==
template_ids
assert
y
.
interfaces
==
interfaces
assert
y
.
description
==
description
assert
y
.
sortid
==
sortid
assert
y
.
title
==
w
[
"title"
]
assert
y
.
parent_id
==
w
[
"parentId"
]
# assert y.template_ids == w["templateIds"]
# assert y.interfaces == w["interfaces"]
# assert y.description == w["description"]
# assert y.sortid == w["sortid"]
assert
x
==
0
@allure.step
(
"断言返回结果"
)
...
...
@@ -177,17 +178,16 @@ class TestHostTypeGet(object):
self
.
check_code
(
response
=
response
,
code
=
2003
)
self
.
check_msg
(
response
=
response
,
msg
=
"账户已被禁用"
)
@allure.title
(
"hosttype.create:成功
创建
"
)
@allure.story
(
"创建业务:成功
创建
"
)
@allure.title
(
"hosttype.create:成功
查询
"
)
@allure.story
(
"创建业务:成功
查询
"
)
@allure.severity
(
"blocker"
)
def
test_case_04
(
self
):
self
.
get_base_token
()
self
.
case_create
(
num
=
"04"
,
parentId
=
0
)
response
=
self
.
hostType_get
()
response
=
self
.
hostType_get
(
token
=
self
.
token
)
self
.
check_code
(
response
=
response
,
code
=
0
)
# self.check_select(response=response, title=title, parent_id=0, template_ids="templateIds",
# interfaces="interfaces", description="description", sortid=255)
self
.
check_select
(
response
=
response
)
if
__name__
==
"__main__"
:
...
...
@@ -197,11 +197,11 @@ if __name__ == "__main__":
import
os
# 执行自动化测试用例
#
case_info = os.path.split(__file__)
#
case = UtilsCmd().pytest_cmd()
#
r = UtilsPyTest(case=case, case_info=case_info)
#
r.run_main()
a
=
TestHostTypeGet
()
a
.
setup_class
()
a
.
test_case_04
()
case_info
=
os
.
path
.
split
(
__file__
)
case
=
UtilsCmd
()
.
pytest_cmd
()
r
=
UtilsPyTest
(
case
=
case
,
case_info
=
case_info
)
r
.
run_main
()
#
a = TestHostTypeGet()
#
a.setup_class()
#
a.test_case_04()
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