Commit 51a491bb by sanshi

巡检任务修改

parent d96d5969
......@@ -134,14 +134,18 @@ class TestInspectionRuleDelete(object):
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_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_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_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_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])
self.app.inspection_rule_get(token=self.token)
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.story("删除巡检任务:删除多个")
......@@ -177,12 +181,12 @@ 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 = TestInspectionRuleDelete()
# a.setup_class()
# a.setup_method()
# a.test_case_05()
# case_info = os.path.split(__file__)
# case = UtilsCmd().pytest_cmd()
# r = UtilsPyTest(case=case, case_info=case_info)
# r.run_main()
a = TestInspectionRuleDelete()
a.setup_class()
a.setup_method()
a.test_case_04()
......@@ -145,12 +145,13 @@ class TestInspectionRuleGet(object):
response = self.app.inspection_rule_get(token=self.token)
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)
for x, y in enumerate(data):
if y["id"] == rule_id_1:
assert y["timeName"] is None
assert y["timeName"] == ""
elif y["id"] == rule_id_2:
assert y["timeName"] == "每16:00"
assert y["timeName"] == "每16:00"
elif y["id"] == rule_id_3:
assert y["timeName"] == "每周一,周四,周六,周日 03:00,21:00"
elif y["id"] == rule_id_4:
......
......@@ -169,4 +169,4 @@ if __name__ == "__main__":
# a = TestInspectionRuleStatus()
# a.setup_class()
# a.setup_method()
# a.test_case_05()
# a.test_case_04()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment