Esempio n. 1
0
    def test8_query_user_by_user_id(self):
        '''
        根据userId查询_无登录Token
        :return:
        '''
        contents = {"userId": "15d6aa852800318"}
        data = {
            "app_id": 'b1044830052f359d',
            "timestamp": '2019-9-25 2:35:56',
            "version": '1.0',
            "client": 'android',
            "client_version": '4.0.1',
            "device_id": '123123',
            "method": 'user.logout',
            "access_token": '{}'.format(None),
            "biz_content": '{}'.format(contents),
        }
        datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
        sign = new_hmac_md5(self.SigSecret, datas)
        datas.update({"sign": sign})

        res = requests.post(url=self.app_host,
                            data=datas,
                            headers=self.headers).json()
        self.assertTrue(res['code'] == 1000, msg="校验code错误")
        miaoshu(url=self.app_host,
                method='post',
                data=datas,
                check={"code and message"},
                respons=res)
Esempio n. 2
0
    def test2_login_byPwd_EorPwd(self):
        '''
        登录-用户存在,密码错误
        :return:
        '''
        contents = {"phone": "18657738815", "password": "******"}
        data = {
            "app_id": 'b1044830052f359d',
            "timestamp": '2019-9-25 2:35:56',
            "version": '1.0',
            "client": 'android',
            "client_version": '4.0.1',
            "device_id": '123123',
            "method": 'user.login_by_password',
            "biz_content": '{}'.format(contents),
        }
        datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
        sign = new_hmac_md5(self.SigSecret, datas)
        datas.update({"sign": sign})

        res = requests.post(url=self.app_host,
                            data=datas,
                            headers=self.headers).json()
        self.assertTrue(res['code'] == 110005, msg="校验code错误")
        miaoshu(url=self.app_host,
                method='post',
                data=datas,
                check={"code and message"},
                respons=res)
Esempio n. 3
0
 def test3_query_station_status(self):
     '''
     设备接口状态查询
     :return:
     '''
     host = self.host
     lujing = 'query_station_status'
     text = {"StationIDs": ["{}".format(self.stationID)]}
     encrypt_data = encrypt(self.DataSecret, str(text))
     data = {
         "OperatorID":
         self.operator_id,
         "Data":
         "{}".format(encrypt_data),
         "TimeStamp":
         "{}".format(self.times),
         "Seq":
         "0001",
         "Sig":
         "{}".format(
             hmac_md5(self.SigSecret, self.operator_id + encrypt_data +
                      self.times + "0001"))
     }
     headers = self.headers
     res = RunMethod().run_main('post', host, lujing, data, headers)
     undata = eval(decrypt(self.DataSecret, res['Data']))
     miaoshu(url=host + lujing,
             method="post",
             data=text,
             check="{'StationIDs', 'ConnectorStatusInfos'}",
             respons=undata)
     self.assertTrue(res['Ret'] == 0, msg="状态码不正确")
     self.assertIn('StationStatusInfos', undata, msg='返回内容不正确')
Esempio n. 4
0
 def test1_query_stations_info(self, text):
     '''
     查询充电站信息
     :return:
     '''
     print(self.headers)
     host = self.host
     lujing = 'query_stations_info'
     encrypt_data = encrypt(self.DataSecret, text)
     data = {
         "OperatorID":
         self.operator_id,
         "Data":
         "{}".format(encrypt_data),
         "TimeStamp":
         "{}".format(self.times),
         "Seq":
         "0001",
         "Sig":
         "{}".format(
             hmac_md5(self.SigSecret, self.operator_id + encrypt_data +
                      self.times + "0001"))
     }
     headers = self.headers
     res = RunMethod().run_main('post', host, lujing, data, headers)
     miaoshu(url=host + lujing,
             method="post",
             data=text,
             check="{Ret and Msg}",
             respons=res)
 def test3_dataMiSS_OperatorID(self):
     '''
     检验post参数不合法,缺少必须参数OperatorID
     :return:
     '''
     host = self.host
     lujing = 'query_token'
     data = {
         "Data": "{}".format(self.encrypt_data),
         "TimeStamp": "{}".format(self.times),
         "Seq": "0001",
         "Sig": "{}".format(self.sig)
     }
     headers = self.headers
     res = RunMethod().run_main('post', host, lujing, data, headers)
     miaoshu(url=host + lujing,
             method="post",
             data=data,
             check="{'Ret': 4003 'Msg': 'POST参数不合法,缺少必须的示例'}",
             respons=res)
     self.assertTrue(res['Ret'] == 4003, msg="状态码不正确")
     self.assertTrue(
         res['Msg'] ==
         "POST参数不合法,缺少必须的示例:OperatorID,sig,TimeStamp,Data,Seq五个参数",
         msg="返回msg不正确")
    def test1_alldata_right(self):
        '''
        检验所有参数正确
        :return:
        '''

        host = self.host
        lujing = 'query_token'
        data = {
            "OperatorID": "359705330",
            "Data": "{}".format(self.encrypt_data),
            "TimeStamp": "{}".format(self.times),
            "Seq": "0001",
            "Sig": "{}".format(self.sig)
        }
        headers = self.headers
        res = RunMethod().run_main('post', host, lujing, data, headers)
        miaoshu(url=host + lujing,
                method="post",
                data=data,
                check="{'Ret': 0, 'Msg': '请求成功'}",
                respons=res)
        print(res)
        self.assertTrue(res['Ret'] == 0, msg="状态码不正确")
        self.assertTrue(res['Msg'] == "请求成功", msg="返回msg不正确")
    def test8_datafield_error(self):
        '''
        检验请求的业务参数不合法(字段命名不正确)
        :return:
        '''

        host = self.host
        lujing = 'query_token'
        text = '{"OperatorID":"359705330","OperatorSecret11":"11"}'
        encrypt_data = encrypt(self.DataSecret, text)
        print(encrypt_data)
        data = {
            "OperatorID":
            "MA35PU38X",
            "Data":
            "{}".format(encrypt_data),
            "TimeStamp":
            "{}".format(self.times),
            "Seq":
            "0001",
            "Sig":
            "{}".format(
                hmac_md5(self.SigSecret,
                         "359705330" + encrypt_data + self.times + "0001"))
        }
        headers = self.headers
        res = RunMethod().run_main('post', host, lujing, data, headers)
        print("请求的业务参数:{}".format(text))
        miaoshu(url=host + lujing,
                method="post",
                data=data,
                check="{'Ret': 4004 'Msg': '请求的业务参数不合法,各接口定义自己的必须参数'}",
                respons=res)
        self.assertTrue(res['Ret'] == 4004, msg="状态码不正确")
        self.assertTrue(res['Msg'] == "请求的业务参数不合法,各接口定义自己的必须参数")
Esempio n. 8
0
    def test2_promote_share(self):
        '''
        分享活动
        :return:
        '''
        contents = {"area_code": "330100", "phone": "18657738817"}
        data = {
            "app_id": 'b1044830052f359d',
            "timestamp": '2019-9-25 2:35:56',
            "version": '1.0',
            "client": 'android',
            "client_version": '4.0.2',
            "device_id": '123123',
            "method": 'promote.share',
            "access_token": '{}'.format(self.token),
            "biz_content": '{}'.format(contents)
        }
        datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
        sign = new_hmac_md5(self.SigSecret, datas)
        datas.update({"sign": sign})

        res = requests.post(url=self.app_host,
                            data=datas,
                            headers=self.headers).json()
        # self.assertTrue(res['code'] == 0, msg="校验code错误")
        miaoshu(url=self.app_host,
                method='post',
                data=datas,
                check={"code and message"},
                respons=res)
Esempio n. 9
0
 def test1_query_equip_auth(self):
     '''
     请求设备认证
     :return:
     '''
     host = self.host
     lujing = 'query_equip_auth'
     text = {
         "EquipAuthSeq": "{}".format(self.EquipAuthSeq),
         "ConnectorID": self.connID
     }
     encrypt_data = encrypt(self.DataSecret, str(text))
     data = {
         "OperatorID":
         self.operator_id,
         "Data":
         "{}".format(encrypt_data),
         "TimeStamp":
         "{}".format(self.times),
         "Seq":
         "0001",
         "Sig":
         "{}".format(
             hmac_md5(self.SigSecret, self.operator_id + encrypt_data +
                      self.times + "0001"))
     }
     headers = self.headers
     res = RunMethod().run_main('post', host, lujing, data, headers)
     undata = eval(decrypt(self.DataSecret, res['Data']))
     miaoshu(url=host + lujing,
             method="post",
             data=text,
             check="{Ret and Msg}",
             respons=undata)
Esempio n. 10
0
    def test2_query_station_list_10(self):
        '''
        查询站点列表信息:查询分页-第一页
        :return:
        '''
        contents = {"page": "1", "length": "10", "station_name": "站点1"}
        data = {
            "app_id": 'b1044830052f359d',
            "timestamp": '2019-9-25 2:35:56',
            "version": '1.0',
            "client": 'android',
            "client_version": '4.0.1',
            "device_id": '123123',
            "method": 'station.query_station_list',
            "access_token": '{}'.format(self.token),
            "biz_content": '{}'.format(contents),
        }
        datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
        sign = new_hmac_md5(self.SigSecret, datas)
        datas.update({"sign": sign})

        res = requests.post(url=self.app_host,
                            data=datas,
                            headers=self.headers).json()
        self.assertTrue(res['code'] == 0, msg="校验code错误")
        miaoshu(url=self.app_host,
                method='post',
                data=datas,
                check={"code and message"},
                respons=res)
Esempio n. 11
0
 def test2_update_station(self):
     '''
     编辑站点
     :return:
     '''
     sql = "select id from cp_station where name='{}'".format(
         self.stationName)
     station_id = mysql_getrows(sql, number='one')[0]
     url = self.app_host + '/api/station/station/update'
     data = {
         "address": "野风现代中心B座1001室",
         "address_en": "",
         "area": "41",
         "charge_speed_type": "1",
         "city": "330100",
         "ext_info": "",
         "lat": "30.285421",
         "lng": "120.176592",
         "name": self.stationName,
         "name_en": "",
         "parking_fee_info": "免停2小时",
         "station_id": "{}".format(station_id),
         "type": "0"
     }
     headers = self.cms_headers
     res = self.session.request('post', url=url, data=data,
                                headers=headers).json()
     self.assertTrue(res['code'] == 200, msg=res)
     miaoshu(url=url,
             method='post',
             data=data,
             check={
                 'code': 200,
             },
             respons=res)
Esempio n. 12
0
    def test1_create_vehicle_notoken(self):
        '''
        新增/修改车辆信息:无token
        :return:
        '''
        contents = {
            "user_id": "{}".format(self.user_id),
            "vehicle_number": "浙AJ1800",
            "vehicle_model": "法拉利"
        }
        data = {
            "app_id": 'b1044830052f359d',
            "timestamp": '2019-9-25 2:35:56',
            "version": '1.0',
            "client": 'android',
            "client_version": '4.0.1',
            "device_id": '123123',
            "method": 'vehicle.create_vehicle',
            "access_token": '{}'.format(None),
            "biz_content": '{}'.format(contents),
        }
        datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
        sign = new_hmac_md5(self.SigSecret, datas)
        datas.update({"sign": sign})

        res = requests.post(url=self.app_host,
                            data=datas,
                            headers=self.headers).json()
        self.assertTrue(res['code'] == 100001, msg="校验code错误")
        miaoshu(url=self.app_host,
                method='post',
                data=datas,
                check={"code and message"},
                respons=res)
Esempio n. 13
0
    def test1_add_station(self):
        '''
        添加站点
        :return:
        '''

        url = self.app_host + '/api/station/station/create'
        data = {
            "address": "野风现代中心B座1001室",
            "address_en": "",
            "area": "41",
            "charge_speed_type": "1",
            "city": "330100",
            "ext_info": "",
            "lat": "30.285421",
            "lng": "120.176592",
            "name": self.stationName,
            "name_en": "",
            "parking_fee_info": "",
            "type": "0"
        }
        headers = self.cms_headers
        res = self.session.request('post', url=url, data=data,
                                   headers=headers).json()
        self.assertTrue(res['code'] == 200, msg=res)
        miaoshu(url=url,
                method='post',
                data=data,
                check={
                    'code': 200,
                },
                respons=res)
Esempio n. 14
0
    def test_17_modifyPhone_sendMsg_NoRegister(self):
        """
        修改手机号:发送验证码_修改后手机号未注册
        :return:
        """

        contents = {"phone": "{}".format(self.new_phone), "type": 5}
        data = {
            "app_id": 'b1044830052f359d',
            "timestamp": '2019-9-25 2:35:56',
            "version": '1.0',
            "client": 'android',
            "client_version": '4.0.1',
            "device_id": '123123',
            "method": 'user.send_verification_code',
            "access_token": '{}'.format(token),
            "biz_content": '{}'.format(contents),
        }
        datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
        sign = new_hmac_md5(self.SigSecret, datas)
        datas.update({"sign": sign})
        res = requests.post(url=self.app_host,
                            data=datas,
                            headers=self.headers).json()
        self.assertTrue(res['code'] == 0, msg="校验code错误")
        miaoshu(url=self.app_host,
                method='post',
                data=datas,
                check={"code and message"},
                respons=res)
Esempio n. 15
0
    def test2_register_errorMsgCode(self):
        '''
        注册:注册用户_错误验证码
        :return:
        '''
        contents = {
            "phone": "{}".format(self.phone),
            "verification_code": "000000",
            "area_code": "3301"
        }
        data = {
            "app_id": 'b1044830052f359d',
            "timestamp": '2019-9-25 2:35:56',
            "version": '1.0',
            "client": 'android',
            "client_version": '4.0.1',
            "device_id": '123123',
            "method": 'user.register',
            "biz_content": '{}'.format(contents),
        }
        datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
        sign = new_hmac_md5(self.SigSecret, datas)
        datas.update({"sign": sign})

        res = requests.post(url=self.app_host,
                            data=datas,
                            headers=self.headers).json()
        self.assertTrue(res['code'] == 110001, msg="校验code错误")
        miaoshu(url=self.app_host,
                method='post',
                data=datas,
                check={"code and message"},
                respons=res)
Esempio n. 16
0
 def test_11_modifyPwdCheckCode_error(self):
     '''
     修改密码:校验验证码(验证码错误)
     :return:
     '''
     contents = {
         "phone": "{}".format(self.phone),
         "type": 3,
         "verification_code": "000000"
     }
     data = {
         "app_id": 'b1044830052f359d',
         "timestamp": '2019-9-25 2:35:56',
         "version": '1.0',
         "client": 'android',
         "client_version": '4.0.1',
         "device_id": '123123',
         "method": 'user.check_verification_code',
         "access_token": '{}'.format(token),
         "biz_content": '{}'.format(contents),
     }
     datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
     sign = new_hmac_md5(self.SigSecret, datas)
     datas.update({"sign": sign})
     res = requests.post(url=self.app_host,
                         data=datas,
                         headers=self.headers).json()
     self.assertTrue(res['code'] == 110001, msg="校验code错误")
     miaoshu(url=self.app_host,
             method='post',
             data=datas,
             check={"code and message"},
             respons=res)
Esempio n. 17
0
 def test5_SendMsg_right(self):
     """
     注册:发送验证码_用户已注册
     :return:
     """
     contents = {"phone": "15715814052", "type": 2}
     data = {
         "app_id": 'b1044830052f359d',
         "timestamp": '2019-9-25 2:35:56',
         "version": '1.0',
         "client": 'android',
         "client_version": '4.0.1',
         "device_id": '123123',
         "method": 'user.send_verification_code',
         "biz_content": '{}'.format(contents),
     }
     datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
     sign = new_hmac_md5(self.SigSecret, datas)
     datas.update({"sign": sign})
     res = requests.post(url=self.app_host,
                         data=datas,
                         headers=self.headers).json()
     self.assertTrue(res['code'] == 110002, msg="校验code错误")
     miaoshu(url=self.app_host,
             method='post',
             data=datas,
             check={"code and message"},
             respons=res)
Esempio n. 18
0
 def test8_ForgetCheckMsgCode_right(self):
     '''
     忘记密码:校验验证码(验证码正确)
     :return:
     '''
     MsgCode = get_cluster_value("forget_password_{}".format(self.phone),
                                 nodes=self.nodes)
     print(MsgCode)
     contents = {
         "phone": "{}".format(self.phone),
         "type": 3,
         "verification_code": "{}".format(MsgCode)
     }
     data = {
         "app_id": 'b1044830052f359d',
         "timestamp": '2019-9-25 2:35:56',
         "version": '1.0',
         "client": 'android',
         "client_version": '4.0.1',
         "device_id": '123123',
         "method": 'user.check_verification_code',
         "biz_content": '{}'.format(contents),
     }
     datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
     sign = new_hmac_md5(self.SigSecret, datas)
     datas.update({"sign": sign})
     res = requests.post(url=self.app_host,
                         data=datas,
                         headers=self.headers).json()
     self.assertTrue(res['code'] == 0, msg="校验code错误")
     miaoshu(url=self.app_host,
             method='post',
             data=datas,
             check={"code and message"},
             respons=res)
 def test5_dataMiSS_TimeStamp(self):
     '''
     检验post参数不合法,缺少必须参数TimeStamp
     :return:
     '''
     encrypt_data = encrypt(self.DataSecret, self.text)
     sig = hmac_md5(self.SigSecret,
                    "359705330" + encrypt_data + self.times + "0001")
     host = self.host
     lujing = 'query_token'
     data = {
         "OperatorID": "359705330",
         "Data": "{}".format(encrypt_data),
         "Seq": "0001",
         "Sig": "{}".format(sig)
     }
     headers = self.headers
     res = RunMethod().run_main('post', host, lujing, data, headers)
     miaoshu(url=host + lujing,
             method="post",
             data=data,
             check="{'Ret': 4003 'Msg': 'POST参数不合法,缺少必须的示例'}",
             respons=res)
     self.assertTrue(res['Ret'] == 4003, msg="状态码不正确")
     self.assertTrue(
         res['Msg'] ==
         "POST参数不合法,缺少必须的示例:OperatorID,sig,TimeStamp,Data,Seq五个参数",
         msg="返回msg不正确")
Esempio n. 20
0
    def test4_register_setPwd(self):
        '''
        注册:设置密码注册
        :return:
        '''

        contents = {"user_id": "{}".format(user_id), "password": "******"}
        data = {
            "app_id": 'b1044830052f359d',
            "timestamp": '2019-9-25 2:35:56',
            "version": '1.0',
            "client": 'android',
            "client_version": '4.0.1',
            "device_id": '123123',
            "method": 'user.update_user',
            "access_token": '{}'.format(token),
            "biz_content": '{}'.format(contents),
        }
        datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
        sign = new_hmac_md5(self.SigSecret, datas)
        datas.update({"sign": sign})

        res = requests.post(url=self.app_host,
                            data=datas,
                            headers=self.headers).json()
        self.assertTrue(res['code'] == 0, msg="校验code错误")
        miaoshu(url=self.app_host,
                method='post',
                data=datas,
                check={"code and message"},
                respons=res)
Esempio n. 21
0
 def test5_query_equip_charge_status(self):
     '''
     查询充电状态
     :return:
     '''
     host = self.host
     lujing = 'query_equip_charge_status'
     text = {"StartChargeSeq": "{}".format(self.order)}
     encrypt_data = encrypt(self.DataSecret, str(text))
     data = {
         "OperatorID":
         self.operator_id,
         "Data":
         "{}".format(encrypt_data),
         "TimeStamp":
         "{}".format(self.times),
         "Seq":
         "0001",
         "Sig":
         "{}".format(
             hmac_md5(self.SigSecret, self.operator_id + encrypt_data +
                      self.times + "0001"))
     }
     headers = self.headers
     res = RunMethod().run_main('post', host, lujing, data, headers)
     miaoshu(url=host + lujing,
             method="post",
             data=text,
             check="{Ret and Msg}",
             respons=res)
     self.assertTrue(res['Ret'] == 0, msg="状态码不正确")
     self.assertTrue(res['Msg'] == "请求成功", msg="返回msg不正确")
Esempio n. 22
0
 def test4_query_notification_start_charge_result(self, text):
     '''
     推送充电结果
     :return:
     '''
     host = self.host
     lujing = 'query_notification_start_charge_result'
     # text = {"StartChargeSeq": "{}".format(self.order), "ConnectorID": "{}".format(self.connID)}
     encrypt_data = encrypt(self.DataSecret, str(text))
     data = {
         "OperatorID":
         self.operator_id,
         "Data":
         "{}".format(encrypt_data),
         "TimeStamp":
         "{}".format(self.times),
         "Seq":
         "0001",
         "Sig":
         "{}".format(
             hmac_md5(self.SigSecret, self.operator_id + encrypt_data +
                      self.times + "0001"))
     }
     headers = self.headers
     res = RunMethod().run_main('post', host, lujing, data, headers)
     print(res)
     # undata = eval(decrypt(self.DataSecret, res['Data']))
     miaoshu(url=host + lujing,
             method="post",
             data=text,
             check="{Ret and Msg}",
             respons=res)
Esempio n. 23
0
    def test3_get_station_list(self):
        '''
        查询充电站列表
        :return:
        '''

        url = self.app_host + '/api/station/station/list'
        data = {
            "area": "",
            "city": "",
            "page": "1",
            "page_size": "10",
            "type": "0"
        }
        headers = self.cms_headers
        res = self.session.request('post', url=url, data=data,
                                   headers=headers).json()
        self.assertTrue(res['code'] == 200, msg=res)
        miaoshu(url=url,
                method='post',
                data=data,
                check={
                    'code': 200,
                },
                respons=res)
Esempio n. 24
0
    def test_15_modifyPwdByOld_right(self):
        '''
        修改密码:通过密码来重置密码_原密码错误
        :return:
        '''
        contents = {
            "user_id": "{}".format(user_id),
            "old_password": "******",
            "new_password": "******"
        }
        data = {
            "app_id": 'b1044830052f359d',
            "timestamp": '2019-9-25 2:35:56',
            "version": '1.0',
            "client": 'android',
            "client_version": '4.0.1',
            "device_id": '123123',
            "method": 'user.reset_password_by_password',
            "access_token": '{}'.format(token),
            "biz_content": '{}'.format(contents),
        }
        datas = dict(sorted(data.items(), key=lambda x: x[0], reverse=False))
        sign = new_hmac_md5(self.SigSecret, datas)
        datas.update({"sign": sign})

        res = requests.post(url=self.app_host,
                            data=datas,
                            headers=self.headers).json()
        self.assertTrue(res['code'] == 0, msg="校验code错误")
        miaoshu(url=self.app_host,
                method='post',
                data=datas,
                check={"code and message"},
                respons=res)
Esempio n. 25
0
 def test5_login_pwd(self):
     '''
     66快充登录:刚注册进行密码登录
     :return:
     '''
     host = self.app_host
     headers = self.headers
     lujing = '/customer/v1/member/login'
     data={"phone":self.phone,"password":"******"}
     res = RunMethod().run_main('post', host, lujing, data, headers)
     self.assertTrue(res['code'] == 0, msg=res['msg'])
     miaoshu(url=host + lujing, method='post', data=data, check={'code': 0, 'msg': 'success'}, respons=res)
Esempio n. 26
0
    def test2_message_code_send(self):
        '''
        发送注册验证码
        :return:
        '''
        host = self.app_host
        headers = self.headers
        lujing = '/system/v1/message_code/send'
        data = {"phone": self.phone, "type": 1, "voice": 0}

        res = RunMethod().run_main('post', host,lujing, data,headers)
        self.assertTrue(res['code'] == 0, msg=res['msg'])
        miaoshu(url=host+lujing,method='post',data=data,check={'code': 0,'msg': 'success'},respons=res)
Esempio n. 27
0
 def test1_member_check_phone(self):
     '''
     验证手机号是否注册
     :return:
     '''
     host = self.app_host
     headers = self.headers
     lujing = '/customer/v1/member/check_phone'
     print(self.phone)
     data = {"phone": self.phone}
     res = RunMethod().run_main('post', host, lujing, data, headers)
     self.assertTrue(res['code'] == 0, msg=res['msg'])
     miaoshu(url=host+lujing,method='post',data=data,check={'code': 0,'msg': 'success'},respons=res)
Esempio n. 28
0
 def test_send_sms(self, data):
     """
     登录页发送短信验证码
     :return:
     """
     # time.sleep()
     host = self.app_host
     headers = self.headers
     lujing = '/system/v1/message_code/send'
     res = self.run.run_main('post', host, lujing, data, headers)
     # self.assertTrue(res['code'] == 0, msg=res['msg'])
     miaoshu(url=host + lujing,
             method='post',
             data=data,
             check={'code and msg'},
             respons=res)
Esempio n. 29
0
 def test_login_pwd(self, data):
     '''
     66快充登录:密码方式
     :param datas:
     :return:
     '''
     host = self.app_host
     headers = self.headers
     lujing = '/customer/v1/member/login'
     res = RunMethod().run_main('post', host, lujing, data, headers)
     # self.assertTrue(res['code'] == 0, msg=res['msg'])
     miaoshu(url=host + lujing,
             method='post',
             data=data,
             check={"code and msg"},
             respons=res)
Esempio n. 30
0
    def test4_get_static_brand(self):
        '''
        获取桩品牌信息
        :return:
        '''

        url = self.app_host + '/api/station/static/brand'
        data = ""
        headers = self.cms_headers
        res = self.session.request('post', url=url, data=data,
                                   headers=headers).json()
        self.assertTrue(res['code'] == 200, msg=res)
        miaoshu(url=url,
                method='post',
                data=data,
                check={
                    'code': 200,
                },
                respons=res)