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
51a491bb
Commit
51a491bb
authored
Dec 20, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
巡检任务修改
parent
d96d5969
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
16 deletions
+21
-16
test_inspection_rule_delete.py
WorkCase/APP/Inspection/test_inspection_rule_delete.py
+17
-13
test_inspection_rule_get.py
WorkCase/APP/Inspection/test_inspection_rule_get.py
+3
-2
test_inspection_rule_status.py
WorkCase/APP/Inspection/test_inspection_rule_status.py
+1
-1
No files found.
WorkCase/APP/Inspection/test_inspection_rule_delete.py
View file @
51a491bb
...
@@ -134,14 +134,18 @@ class TestInspectionRuleDelete(object):
...
@@ -134,14 +134,18 @@ class TestInspectionRuleDelete(object):
businessIds
=
[
self
.
base_business_id_1
,
self
.
base_business_id_2
])
businessIds
=
[
self
.
base_business_id_1
,
self
.
base_business_id_2
])
rule_id_1
=
self
.
app
.
case_create_inspection_rule
(
name
=
name_1
,
time
=
None
,
period
=
None
,
_type
=
1
,
hosts
=
host_id
)
rule_id_1
=
self
.
app
.
case_create_inspection_rule
(
name
=
name_1
,
time
=
None
,
period
=
None
,
_type
=
1
,
hosts
=
host_id
)
rule_id_2
=
self
.
app
.
case_create_inspection_rule
(
name
=
name_2
,
time
=
"[][16]"
,
period
=
1
,
_type
=
2
,
hosts
=
host_id
)
#
rule_id_2 = self.app.case_create_inspection_rule(name=name_2, time="[][16]", period=1, _type=2, hosts=host_id)
rule_id_3
=
self
.
app
.
case_create_inspection_rule
(
name
=
name_3
,
time
=
"[1,4,6,7][3,21]"
,
period
=
2
,
_type
=
2
,
hosts
=
host_id
)
#
rule_id_3 = self.app.case_create_inspection_rule(name=name_3, time="[1,4,6,7][3,21]", period=2, _type=2, hosts=host_id)
rule_id_4
=
self
.
app
.
case_create_inspection_rule
(
name
=
name_4
,
time
=
"[2,5,20,25,31][5,19]"
,
period
=
3
,
_type
=
2
,
hosts
=
host_id
)
#
rule_id_4 = self.app.case_create_inspection_rule(name=name_4, time="[2,5,20,25,31][5,19]", period=3, _type=2, hosts=host_id)
response
=
self
.
app
.
inspection_rule_delete
(
token
=
self
.
token
,
ruleids
=
[
rule_id_1
])
response
=
self
.
app
.
inspection_rule_delete
(
token
=
self
.
token
,
ruleids
=
[
rule_id_1
])
self
.
app
.
inspection_rule_get
(
token
=
self
.
token
)
self
.
app
.
inspection_rule_get
(
token
=
self
.
token
)
self
.
app
.
check_code
(
response
=
response
,
code
=
0
)
self
.
app
.
check_code
(
response
=
response
,
code
=
0
)
self
.
check_select
(
rule_id
=
rule_id_2
,
status
=
CaseBase
()
.
status
[
"ON"
],
del_flag
=
CaseBase
()
.
del_flag
[
"ON"
])
self
.
check_select
(
rule_id
=
rule_id_1
,
status
=
CaseBase
()
.
status
[
"ON"
],
del_flag
=
CaseBase
()
.
del_flag
[
"ON"
])
response
=
self
.
app
.
inspection_rule_get
(
token
=
self
.
token
,
name
=
name_1
)
self
.
app
.
check_code
(
response
=
response
,
code
=
0
)
assert
UtilsResponse
()
.
get_data_data
(
response
=
response
)
==
[]
@allure.title
(
"inspections.rule.delete:删除多个"
)
@allure.title
(
"inspections.rule.delete:删除多个"
)
@allure.story
(
"删除巡检任务:删除多个"
)
@allure.story
(
"删除巡检任务:删除多个"
)
...
@@ -177,12 +181,12 @@ if __name__ == "__main__":
...
@@ -177,12 +181,12 @@ if __name__ == "__main__":
import
os
import
os
# 执行自动化测试用例
# 执行自动化测试用例
case_info
=
os
.
path
.
split
(
__file__
)
#
case_info = os.path.split(__file__)
case
=
UtilsCmd
()
.
pytest_cmd
()
#
case = UtilsCmd().pytest_cmd()
r
=
UtilsPyTest
(
case
=
case
,
case_info
=
case_info
)
#
r = UtilsPyTest(case=case, case_info=case_info)
r
.
run_main
()
#
r.run_main()
#
a = TestInspectionRuleDelete()
a
=
TestInspectionRuleDelete
()
#
a.setup_class()
a
.
setup_class
()
#
a.setup_method()
a
.
setup_method
()
# a.test_case_05
()
a
.
test_case_04
()
WorkCase/APP/Inspection/test_inspection_rule_get.py
View file @
51a491bb
...
@@ -145,12 +145,13 @@ class TestInspectionRuleGet(object):
...
@@ -145,12 +145,13 @@ class TestInspectionRuleGet(object):
response
=
self
.
app
.
inspection_rule_get
(
token
=
self
.
token
)
response
=
self
.
app
.
inspection_rule_get
(
token
=
self
.
token
)
self
.
app
.
check_code
(
response
=
response
,
code
=
0
)
self
.
app
.
check_code
(
response
=
response
,
code
=
0
)
self
.
app
.
check_keyValue
(
_json
=
UtilsResponse
()
.
get_data_data
(
response
=
response
),
_key
=
"del_flag"
,
_value
=
CaseBase
()
.
status
[
"ON"
])
data
=
UtilsResponse
()
.
get_data_data
(
response
=
response
)
data
=
UtilsResponse
()
.
get_data_data
(
response
=
response
)
for
x
,
y
in
enumerate
(
data
):
for
x
,
y
in
enumerate
(
data
):
if
y
[
"id"
]
==
rule_id_1
:
if
y
[
"id"
]
==
rule_id_1
:
assert
y
[
"timeName"
]
is
None
assert
y
[
"timeName"
]
==
""
elif
y
[
"id"
]
==
rule_id_2
:
elif
y
[
"id"
]
==
rule_id_2
:
assert
y
[
"timeName"
]
==
"每
日
16:00"
assert
y
[
"timeName"
]
==
"每
天
16:00"
elif
y
[
"id"
]
==
rule_id_3
:
elif
y
[
"id"
]
==
rule_id_3
:
assert
y
[
"timeName"
]
==
"每周一,周四,周六,周日 03:00,21:00"
assert
y
[
"timeName"
]
==
"每周一,周四,周六,周日 03:00,21:00"
elif
y
[
"id"
]
==
rule_id_4
:
elif
y
[
"id"
]
==
rule_id_4
:
...
...
WorkCase/APP/Inspection/test_inspection_rule_status.py
View file @
51a491bb
...
@@ -169,4 +169,4 @@ if __name__ == "__main__":
...
@@ -169,4 +169,4 @@ if __name__ == "__main__":
# a = TestInspectionRuleStatus()
# a = TestInspectionRuleStatus()
# a.setup_class()
# a.setup_class()
# a.setup_method()
# a.setup_method()
# a.test_case_0
5
()
# a.test_case_0
4
()
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