浏览代码

获取信息类型、修改信息类型

yuanyuan 6 月之前
父节点
当前提交
e80af55c10

+ 16 - 0
cases/pc/登录功能/订阅/entnichenew_info_type.py

@@ -0,0 +1,16 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    #测试用例名称
+    name='获取信息类型'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.entnichenew_infotype()
+        res = r.json()
+        actural  = res['error_code']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查信息类型获取是否正常',actural == 0)

+ 17 - 0
cases/pc/登录功能/订阅/ntnichenew_info_update.py

@@ -0,0 +1,17 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    #测试用例名称
+    name='修改信息类型'
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.entnichenew_infotype_update()
+        res = r.json()
+        actural  = res['error_code']
+        actural1 = res['data']['status']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查信息类型修改设置是否正常',actural == 0 and actural1 == 1)

+ 26 - 0
lib/webapi.py

@@ -1188,6 +1188,32 @@ class APIMgr():
         response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/area/get", headers=headers,json=json)
         return response
 
+    # 获取信息类型
+    def entnichenew_infotype(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "identity": "ent"
+        }
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/index", headers=headers,json=json)
+        return response
+
+    # 修改信息类型
+    def entnichenew_infotype_update(self):
+        headers = GSTORE['headers']
+        s = GSTORE['s']
+        json = {
+            "msg": [
+                "预告",
+                "预审",
+                "预审结果",
+                "论证意见",
+                "需求公示"
+            ],
+            "identity": "ent"
+        }
+        response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/infotype/update", headers=headers,json=json)
+        return response
 
 apimgr = APIMgr()