Commit 743901ad by sanshi

设备类型

parent c440e804
......@@ -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()
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