Beispiel #1
0
    def test_088_01(self):
        testname = "上传病害word文件"
        expect = "成功"
        param = {}
        #获取所有数据列表
        data_all_list = RequestAPI().API_get_code(
            "diseaseRecord/listRecord?diseaseCode=&current=1&size=10&diseaseTypes=&periodId=&tunnelId=",
            param, token)['Response_Data']["data"]
        diseaseId = data_all_list['records'][0]["diseaseId"]
        #获取单个信息
        #data_One_info = RequestAPI().API_get_code("diseaseRecord/diseaseRecordInfo?diseaseId=%s&diseaseRecordId=%s" % (diseaseId,diseaseId), param, token)["Response_Data"]['data']
        #拿到信息上传
        dic_data = {'diseaseRecordId': diseaseId}
        word_file = '123.docx'
        #API_post_code_upload(self,path, dic_data,filepath,token)
        data = RequestAPI().API_post_code_upload(
            "diseaseRecord/diseaseUploadProcFile", dic_data, word_file, token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(str(data["expect"]), str(data["Response_Data"]))
Beispiel #2
0
    def test_080_01(self):
        testname = "编辑工程阶段"
        expect = "修改成功"
        param = {}
        #获取所有数据列表
        data_all_list = RequestAPI().API_get_code(
            "tunnel/sytstage/queryPage?current=1&size=5&queryParam=", param,
            token)['Response_Data']["data"]
        #获取单个信息
        data_One_info = RequestAPI().API_get_code(
            "tunnel/sytstage/get/%s" % data_all_list['records'][0]["stageId"],
            param, token)["Response_Data"]['data']
        #拿到信息编辑更新
        data_One_info = {
            "stageId": data_One_info['stageId'],
            "stageName": data_One_info['stageName'],
            "tunnelId": data_One_info['tunnelId']
        }
        data = RequestAPI().API_post_code("tunnel/sytstage/edit",
                                          data_One_info, token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(str(data["expect"]), str(data["Response_Data"]))
Beispiel #3
0
    def test_050(self):

        testname = "获取ws地址"
        expect = str(url.split(":")[1])
        data_login = RequestAPI().API_post_code("sys/login", {
            "userName": "******",
            "password": "******"
        }, token)['Response_Data']

        param = {
            "carName": "tets1",
            "carCode": "tets1",
            "companyId": 2,
            "carType": "railway",
            "currentLocation": "tets1"
        }
        data = RequestAPI().API_get_code(
            "sys/user/getSocketUrl/%s" % data_login['data']['userId'], param,
            token)

        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(str(url.split(":")[1]), str(data["Response_Data"]))
Beispiel #4
0
    def test_051(self):
        testname = "新增报表"
        expect = "成功"
        param = {
            "diseaseTypeList": [
                "disease_type_spalling", "disease_type_leak_water",
                "disease_type_crackle", "radar_disease_type_3",
                "radar_disease_type_4", "radar_disease_type_1",
                "radar_disease_type_2"
            ],
            "periodId":
            1,
            "stageId":
            1,
            "tunnelId":
            1
        }
        data = RequestAPI().API_post_code("report/syt/add", param, token)

        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(expect, str(data["Response_Data"]))
Beispiel #5
0
    def test_087(self):
        testname = "Excle地址检查"
        expect = str(url.split(":")[1])
        param = {}
        data = RequestAPI().API_get_code('sys/config/findFileUrl', param,
                                         token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(expect,
                      str(data["Response_Data"]['data']['httpExcelUrl']))
Beispiel #6
0
 def test_082(self):
     testname = "新增使用单位"
     expect = "保存成功"
     param = {
         "provinceCode": "610000",
         "cityCode": "610300",
         "companyName": "西安铁路宝鸡分局_tets001"
     }
     data = RequestAPI().API_post_code('tunnel/sytcompany/add', param,
                                       token)
     data.update({
         "testname": testname,
         'expect': expect,
         "project": project
     })
     Out_info().html_out_info(data)
     self.assertIn(expect, str(data["Response_Data"]))
Beispiel #7
0
    def test_063(self):
        testname = "删除人员"
        expect = "删除成功"

        user_list = RequestAPI().API_get_code(
            'sys/user/queryPage?current=1&size=5&select=huangpeng110', {},
            token)['Response_Data']['data']['records']

        param = {}
        data = RequestAPI().API_delete_code(
            'sys/user/del/%s' % user_list[0]['userId'], param, token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)
        self.assertIn(expect, str(data["Response_Data"]))
Beispiel #8
0
    def test_002(self):
        testname = "删除车辆"
        expect = "删除成功"
        param = {}
        data_car_list = RequestAPI().API_get_code(
            "vehicle/sytcarinfo/page?current=1&size=10&carType=&provinceCode=420000&cityCode=420100&companyId=&healthStatus=&workState=&carCode=tets1",
            param, token)['Response_Data']["data"]

        data = RequestAPI().API_delete_code(
            "vehicle/sytcarinfo/del/%s" % data_car_list['records'][0]["carId"],
            param, token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(str(data["expect"]), str(data["Response_Data"]))
Beispiel #9
0
    def test_065(self):
        testname = "删除隧道"
        expect = "删除成功"

        user_list = RequestAPI().API_get_code(
            'tunnel/sytline/page?current=1&size=5&queryParam=', {},
            token)['Response_Data']['data']['records']

        param = {}
        data = RequestAPI().API_delete_code(
            'tunnel/sytline/del?tunnelId=%s' % user_list[0]['tunnelId'], param,
            token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)
        self.assertIn(expect, str(data["Response_Data"]))
Beispiel #10
0
    def test_001(self):
        testname = "核对裂缝告警数量"
        expect = "保存成功"
        param = {
            "carName": "tets1",
            "carCode": "tets1",
            "companyId": 2,
            "carType": "railway",
            "currentLocation": "tets1"
        }
        data = RequestAPI().API_post_code("vehicle/sytcarinfo/add", param,
                                          token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(str(data["expect"]), str(data["Response_Data"]))
Beispiel #11
0
    def test_083(self):
        testname = "删除使用单位"
        expect = "删除成功"

        user_list = \
            RequestAPI().API_get_code('tunnel/sytcompany/queryPage?current=1&size=5&queryParam=%E8%A5%BF%E5%AE%89%E9%93%81%E8%B7%AF%E5%AE%9D%E9%B8%A1%E5%88%86%E5%B1%80_tets001', {},
                                      token)[
                'Response_Data']['data']['records']

        param = {}
        data = RequestAPI().API_delete_code(
            'tunnel/sytcompany/del/%s' % user_list[0]['companyId'], param,
            token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)
        self.assertIn(expect, str(data["Response_Data"]))
Beispiel #12
0
    def test_053(self):
        testname = "删除报表"
        expect = "删除成功"

        Excle_list = RequestAPI().API_get_code(
            "report/syt/page?reportCode=&current=1&size=10", {},
            token)['Response_Data']['data']['records']

        param = {}
        data = RequestAPI().API_delete_code(
            "report/syt/del/%s" % Excle_list[1]["reportId"], param, token)

        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(expect, str(data["Response_Data"]))
Beispiel #13
0
    def test_003(self):
        testname = "编辑车辆"
        expect = "修改成功"
        param = {}
        data_car_list = RequestAPI().API_get_code(
            "vehicle/sytcarinfo/page?cityCode=610300&current=1&provinceCode=610000&size=5",
            param, token)['Response_Data']["data"]

        data_carinfo = RequestAPI().API_get_code(
            "vehicle/sytcarinfo/get/%s" % data_car_list['records'][0]["carId"],
            param, token)["Response_Data"]['data']
        data = RequestAPI().API_put_code("vehicle/sytcarinfo/edit",
                                         data_carinfo, token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(str(data["expect"]), str(data["Response_Data"]))
Beispiel #14
0
 def test_060(self):
     testname = "新增人员"
     expect = "成功"
     param = {
         "username": "******",
         "password": "******",
         "realname": "hp",
         "company": "单位单位单位",
         "phone": "18392040001",
         "email": "*****@*****.**",
         "roleId": 1,
         "tunnelId": 1,
         "perIds": [1, 2, 3, 4, 5, 6]
     }
     data = RequestAPI().API_post_code('sys/user/add', param, token)
     data.update({
         "testname": testname,
         'expect': expect,
         "project": project
     })
     Out_info().html_out_info(data)
     self.assertIn(expect, str(data["Response_Data"]))
Beispiel #15
0
    def test_062(self):
        testname = "编辑人员"
        expect = "成功"
        param = {}
        data_car_list = RequestAPI().API_get_code(
            "sys/user/queryPage?current=1&size=5&select=", param,
            token)['Response_Data']["data"]

        data_userinfo = RequestAPI().API_get_code(
            "sys/user/get/%s" % data_car_list['records'][0]["userId"], param,
            token)["Response_Data"]['data']
        # param_info={
        #     "userId": data_userinfo['userId'],
        #     "username": "******",
        #     "realname": "hjad",
        #     "company": "huadd",
        #     "phone": "18392040045",
        #     "email": "*****@*****.**",
        #     "roleId": 2,
        #     "tunnelId": 1,
        #     "perIds": [1, 2, 3, 4, 5, 6]
        # }
        data_userinfo.update(
            {"tunnelId": data_userinfo['userLine']['tunnelId']})
        del data_userinfo['userPers']
        del data_userinfo['userLine']
        data_userinfo.update({"perIds": [1, 2, 3, 4, 5, 6]})
        data = RequestAPI().API_post_code("sys/user/edit", data_userinfo,
                                          token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(str(data["expect"]), str(data["Response_Data"]))
Beispiel #16
0
    def test_084_01(self):
        testname = "编辑规则"
        expect = "修改成功"
        param = {}
        #获取所有数据列表
        data_all_list = RequestAPI().API_get_code(
            "tunnel/sytalarmrule/queryPage?queryParam=&current=1&size=5",
            param, token)['Response_Data']["data"]
        #获取单个信息
        data_One_info = RequestAPI().API_get_code(
            "tunnel/sytalarmrule/get/%s" %
            data_all_list['records'][0]["alarmRuleId"], param,
            token)["Response_Data"]['data']
        #拿到信息编辑更新
        data = RequestAPI().API_post_code("tunnel/sytalarmrule/edit",
                                          data_One_info, token)
        data.update({
            "testname": testname,
            'expect': expect,
            "project": project
        })
        Out_info().html_out_info(data)

        self.assertIn(str(data["expect"]), str(data["Response_Data"]))
Beispiel #17
0
 def test_064(self):
     testname = "新增隧道"
     expect = "保存成功"
     param = {
         "altitudeHight": "2000",
         "buildTypeStr": "河北地铁",
         "designSpeed": "2365",
         "geoTypeStr": "河北地铁",
         "rainRang": "5000",
         "temperatureRang": "30",
         "tunnelLength": "23546",
         "tunnelName": "河北地铁",
         "provinceCode": "130000",
         "cityCode": "130100",
         "tunnelType": "tunnel_type_1"
     }
     data = RequestAPI().API_post_code('tunnel/sytline/add', param, token)
     data.update({
         "testname": testname,
         'expect': expect,
         "project": project
     })
     Out_info().html_out_info(data)
     self.assertIn(expect, str(data["Response_Data"]))