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
f5e992ae
Commit
f5e992ae
authored
Nov 26, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备类型
parent
46f04e1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
16 deletions
+40
-16
test_hosttype_get.py
WorkCase/APP/HostType/test_hosttype_get.py
+39
-16
host_types.py
WorkData/Argus/host_types.py
+1
-0
No files found.
WorkCase/APP/HostType/test_hosttype_get.py
View file @
f5e992ae
...
...
@@ -102,9 +102,9 @@ class TestHostTypeGet(object):
return
api
.
response
@allure.step
(
"创建测试数据"
)
def
case_create
(
self
,
num
,
parentId
):
title
=
self
.
base_title
+
num
response
=
self
.
hostType_create
(
token
=
self
.
token
,
title
=
title
,
parentId
=
parentId
)
def
case_create
(
self
,
num
,
parentId
,
description
):
self
.
title
=
self
.
base_title
+
num
response
=
self
.
hostType_create
(
token
=
self
.
token
,
title
=
self
.
title
,
parentId
=
parentId
,
description
=
description
)
self
.
host_type_id
=
UtilsResponse
()
.
get_data
(
response
=
response
)
return
self
.
host_type_id
...
...
@@ -125,17 +125,17 @@ class TestHostTypeGet(object):
return
sql
@allure.step
(
"校验查询结果"
)
def
check_select
(
self
,
response
):
def
check_select
(
self
,
response
,
title
,
parent_id
,
template_ids
,
interfaces
,
description
,
sortid
):
data
=
UtilsResponse
()
.
get_data
(
response
=
response
)
for
q
,
w
in
enumerate
(
data
[
"list"
][
"records"
]):
sql
=
self
.
select_hosttype
(
_id
=
w
[
"id"
])
for
x
,
y
in
enumerate
(
sql
):
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
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
x
==
0
@allure.step
(
"断言返回结果"
)
...
...
@@ -178,16 +178,39 @@ 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:
title
成功查询"
)
@allure.story
(
"创建业务:
title
成功查询"
)
@allure.severity
(
"blocker"
)
def
test_case_04
(
self
):
self
.
get_base_token
()
self
.
case_create
(
num
=
"04"
,
parentId
=
0
)
self
.
case_create
(
num
=
"04"
,
parentId
=
0
,
description
=
None
)
response
=
self
.
hostType_get
(
token
=
self
.
token
)
response
=
self
.
hostType_get
(
token
=
self
.
token
,
title
=
self
.
title
)
self
.
check_code
(
response
=
response
,
code
=
0
)
self
.
check_select
(
response
=
response
,
title
=
self
.
title
,
parent_id
=
0
,
template_ids
=
None
,
interfaces
=
None
,
description
=
None
,
sortid
=
None
)
@allure.title
(
"hosttype.create:parentId成功查询"
)
@allure.story
(
"创建业务:parentId成功查询"
)
def
test_case_05
(
self
):
self
.
get_base_token
()
self
.
case_create
(
num
=
"05"
,
parentId
=
1
,
description
=
None
)
response
=
self
.
hostType_get
(
token
=
self
.
token
,
parentId
=
1
)
self
.
check_code
(
response
=
response
,
code
=
0
)
self
.
check_select
(
response
=
response
,
title
=
self
.
title
,
parent_id
=
1
,
template_ids
=
None
,
interfaces
=
None
,
description
=
None
,
sortid
=
None
)
@allure.title
(
"hosttype.create:description成功查询"
)
@allure.story
(
"创建业务:description成功查询"
)
def
test_case_06
(
self
):
self
.
get_base_token
()
self
.
case_create
(
num
=
"06"
,
parentId
=
1
,
description
=
"description"
)
response
=
self
.
hostType_get
(
token
=
self
.
token
,
description
=
"description"
)
self
.
check_code
(
response
=
response
,
code
=
0
)
self
.
check_select
(
response
=
response
)
self
.
check_select
(
response
=
response
,
title
=
self
.
title
,
parent_id
=
1
,
template_ids
=
None
,
interfaces
=
None
,
description
=
"description"
,
sortid
=
None
)
if
__name__
==
"__main__"
:
...
...
@@ -204,4 +227,4 @@ if __name__ == "__main__":
# a = TestHostTypeGet()
# a.setup_class()
# a.test_case_0
4
()
# a.test_case_0
6
()
WorkData/Argus/host_types.py
View file @
f5e992ae
...
...
@@ -14,6 +14,7 @@ from WorkUtils.UtilsDataBase import UtilsDataBase
import
time
Base
=
declarative_base
()
...
...
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