def test_queryLoanProductByListId(self, name, id, tags, productId,
                                   clientType, queryRecProduct, versionName,
                                   queryType, dataType, deviceId):
     """轻松借模块列表接口"""
     values = login.LoginByPassWord().login_by_password(
         int(globa_phone.phone()))
     userId = values[0]
     token = values[1]
     pa = {
         "id": id,
         "tags": tags,
         "deviceId": deviceId,
         "productId": productId,
         "userId": userId,
         "token": token,
         "clientType": clientType,
         "queryRecProduct": queryRecProduct,
         "versionName": versionName,
         "queryType": queryType,
         "dataType": dataType
     }
     self.params = global_base.DefTool().payload(**pa)
     header = {"token": token}
     self.result = requests.post(url=self.url,
                                 headers=header,
                                 data=self.params).json()
     self.assertEqual(self.result["msg"], "ok")
     self.assertEqual(self.result['code'], '200')
Exemplo n.º 2
0
 def test_getProtocol(self, name, productId, channelId, type, auditStatus,
                      appVersion, deviceId, source, mjbname, timestamp):
     """关于我们接口"""
     values = login.LoginByPassWord().login_by_password(
         int(globa_phone.phone()))
     fromUserId = values[0]
     token = values[1]
     pa = {
         "productId": productId,
         "channelId": channelId,
         "type": type,
         "deviceId": deviceId,
         "deviceType": auditStatus,
         "auditStatus": appVersion,
         "appVersion": productId,
         "timestamp": timestamp,
         "source": source,
         "mjbname": mjbname,
         "fromUserId": fromUserId,
         "token": token
     }
     self.params = global_base.DefTool().payload(**pa)
     self.result = requests.post(url=self.url, data=self.params).json()
     self.assertEqual(self.result["msg"], "ok")
     self.assertEqual(self.result['code'], 200)
     self.assertEqual(self.result['data']['title'], "关于我们")
Exemplo n.º 3
0
 def test_getMsgReadStatus(self, name, method, json, callbackName, ver,
                           verno, deviceId, deviceType, productId,
                           channelId, deviceToken, mjbname):
     """获取消息状态"""
     params = {
         "method": method,
         "json": json,
         "callbackName": callbackName,
         "ver": ver,
         "verno": verno,
         "deviceId": deviceId,
         "deviceType": deviceType,
         "productId": productId,
         "channelId": channelId,
         "deviceToken": deviceToken,
         "mjbname": mjbname
     }
     self.params = global_base.DefTool().payload(**params)
     phone = int(globa_phone.phone())
     value = login.LoginByPassWord().login_by_password(phone)
     token = value[1]
     header = {"token": token}
     self.result = requests.post(url=self.url,
                                 headers=header,
                                 data=self.params).json()
     self.assertEqual(self.result["msg"], "ok")
     self.assertEqual(self.result["code"], 200)
Exemplo n.º 4
0
 def test_record_add(self, name, deviceId, productId, deviceType, targetId,
                     channelId, actType, versionName, versionNo, actSource):
     """排重接口"""
     values = login.LoginByPassWord().login_by_password(
         int(globa_phone.phone()))
     token = values[1]
     accountId = values[0]
     code = "1234512dd"
     pa = {
         "targetId": targetId,
         "code": code,
         "accountId": accountId,
         "deviceId": deviceId,
         "actType": actType,
         "deviceType": deviceType,
         "productId": productId,
         "channelId": channelId,
         "versionName": versionName,
         "versionNo": versionNo,
         "actSource": actSource,
         "token": token
     }
     self.params = global_base.DefTool().payload(**pa)
     self.result = requests.post(url=self.url, data=self.params).json()
     self.assertEqual(self.result["msg"], "ok")
     self.assertEqual(self.result['code'], 200)
 def test_getMainLinkBySublink(self, name, suggestcontent, contactway,
                               deviceId, ver, verno, productId, deviceType,
                               channelId, deviceToken, mjbname):
     """我的建议接口"""
     values = login.LoginByPassWord().login_by_password(
         int(globa_phone.phone()))
     token = values[1]
     header = {"token": token}
     pa = {
         "suggestcontent": suggestcontent,
         "contactway": contactway,
         "deviceId": deviceId,
         "ver": ver,
         "verno": verno,
         "productId": productId,
         "channelId": channelId,
         "deviceToken": deviceToken,
         "mjbname": mjbname,
         "deviceType": deviceType
     }
     self.params = global_base.DefTool().payload(**pa)
     self.result = requests.post(url=self.url,
                                 headers=header,
                                 data=self.params).json()
     self.assertEqual(self.result["msg"], "ok")
     self.assertEqual(self.result['code'], 200)
 def test_logout(self, name, deviceId, ver, verno, productId, deviceType, channelId, deviceToken, mjbname):
     """退出登陆接口"""
     pa = {"verno": verno, "deviceId": deviceId, "ver": ver, "deviceType": deviceType,
           "productId": productId, "channelId": channelId, "deviceToken": deviceToken, "mjbname": mjbname}
     self.params = global_base.DefTool().payload(**pa)
     token = login.LoginByPassWord().login_by_password(int(globa_phone.phone()))[1]
     header = {"token": token}
     self.result = requests.post(url=self.url, headers=header, data=self.params).json()
     self.assertEqual(self.result["msg"], "ok")
     self.assertEqual(self.result['code'], 200)
Exemplo n.º 7
0
 def test_get_history_by_userId(self, name, deviceId, productId, deviceType, actType, pageIndex, pageSize):
     """查询历史纪录接口"""
     value = login.LoginByPassWord().login_by_password(int(globa_phone.phone()))
     token = value[1]
     accountId = value[0]
     self.params = {"deviceId": deviceId, "accountId": accountId, "productId": productId, "deviceType": deviceType,
               "actType": actType, "token": token, "pageIndex": pageIndex, "pageSize": pageSize}
     self.result = requests.post(url=self.url, data=self.params).json()
     self.assertEqual(self.result["msg"], "ok")
     self.assertEqual(self.result["code"], '200')
    def test_attendance(self, name, deviceType, deviceId, msg, code,
                        continueDay):
        """签到接口"""
        if name == "首签成功":
            value = login.LoginByPassWord()
            self.phone = int(globa_phone.phone())
            values = value.login_by_password(self.phone)
            self.accountId = values[0]
            self.token = values[1]
            self.params = {
                "accountId": self.accountId,
                "deviceType": deviceType,
                "token": self.token,
                "deviceId": deviceId
            }
            # 删除数据库对应账号的签到信息
            # sqlDelete = ("DELETE FROM sinaif_easy.t_user_attendance WHERE accountid = {};".format(self.accountId))
            # doSQL = test_db.T_DB.t_db_delete(self, sqlDelete)

            self.result = requests.post(url=self.url, data=self.params).json()
            self.assertEqual(self.result["msg"], msg)
            self.assertEqual(self.result["code"], code)
            self.assertEqual(
                self.result['data']['attendanceInfo']['continueDay'],
                continueDay)
        elif name == "重复签到":
            value = login.LoginByPassWord()
            self.phone = int(globa_phone.phone())
            values = value.login_by_password(self.phone)
            self.accountId = values[0]
            self.token = values[1]
            self.params = {
                "accountId": self.accountId,
                "deviceType": deviceType,
                "token": self.token,
                "deviceId": deviceId
            }
            self.result = requests.post(url=self.url, data=self.params).json()
            self.assertEqual(self.result["msg"], msg)
            self.assertEqual(self.result["code"], code)
 def test_getSmartMatchList(self, name, id, productId, clientType):
     """智能推荐接口"""
     values = login.LoginByPassWord().login_by_password(
         int(globa_phone.phone()))
     accountid = values[0]
     self.params = {
         "id": id,
         "clientType": clientType,
         "productId": productId,
         "accountid": accountid
     }
     self.result = requests.post(url=self.url, data=self.params).json()
     self.assertEqual(self.result["msg"], "ok")
     self.assertEqual(self.result['code'], '200')
Exemplo n.º 10
0
 def test_update_user_info(self, name, method, idcard, json, callbackName, username, tags, ver, verno,
                           deviceId, deviceType, productId, channelId, deviceToken, mjbname, msg, code):
     """更新用户信息接口"""
     mobile = int(globa_phone.phone())
     token = login.LoginByPassWord().login_by_password(mobile)[1]
     header = {"token": token}
     params = {"method": method, "idcard": idcard, "mobile": mobile, "json": json, "callbackName": callbackName,
               "username": username, "tags": tags, "ver": ver, "verno": verno, "deviceId": deviceId,
               "deviceType": deviceType, "productId": productId, "channelId": channelId, "deviceToken": deviceToken,
               "mjbname": mjbname}
     self.params = global_base.DefTool().payload(**params)
     self.result = requests.post(url=self.url, headers=header, data=self.params).json()
     self.assertEqual(self.result["msg"], msg)
     self.assertEqual(self.result["code"], code)
Exemplo n.º 11
0
 def test_get_new_loan_product(self, name, productId, clientType, pageIndex,
                               pageSize, dataType, deviceId):
     """最新口子接口"""
     token = login.LoginByPassWord().login_by_password(
         int(globa_phone.phone()))[1]
     self.params = {
         "deviceId": deviceId,
         "productId": productId,
         "token": token,
         "pageIndex": pageIndex,
         "pageSize": pageSize,
         "clientType": clientType
     }
     self.result = requests.post(url=self.url, data=self.params).json()
     self.assertEqual(self.result["msg"], "ok")
     self.assertEqual(self.result["code"], '200')
 def test_saveGps(self, name, productId, channelId, strJson, timestamp, deviceToken, deviceId, source, deviceType,
                      mjbname, ver, verno):
     """保存GPS接口"""
     pa = {"productId": productId, "channelId": channelId, "strJson": strJson, "timestamp": timestamp,
           "deviceToken": deviceToken,
           "deviceId": deviceId, "source": source, "deviceType": deviceType, "mjbname": mjbname, "ver": ver, "verno": verno}
     self.params = global_base.DefTool().payload(**pa)
     values = login.LoginByPassWord().login_by_password(int(globa_phone.phone()))
     token = values[1]
     headers = {"token": token}
     self.result = requests.post(url=self.url, headers=headers, data=self.params).json()
     try:
         self.assertEqual(self.result["msg"], "ok")
         self.assertEqual(self.result['code'], 200)
         self.assertEqual(self.result['data']['title'], "关于我们")
     except Exception as e:
         print(e)
Exemplo n.º 13
0
 def send_phone_code_token(self, phone):
     url = global_base.DefTool.url(self, '/usercenter/sys/sendPhoneCode')
     pa_new = {"phone": phone, "type": "4", "verno": 15, "deviceId": "867910035562539", "ver": "2.6.0",
               "deviceType": "1",
               "productId": "1003", "channelId": "sinaif", "deviceToken": "ef70fb3178dccde19df9295a68aca0a3",
               "mjbname": "qsj"}
     params = global_base.DefTool().payload(**pa_new)
     values = login.LoginByPassWord().login_by_password(phone)
     token = values[1]
     headers = {"token": token}
     time.sleep(5)
     send_code = requests.post(url=url, headers=headers, data=params).json()
     sql = 'SELECT mobile, smscode FROM sinaif_easy.t_app_smsinfo WHERE mobile= {} ORDER BY sendtime DESC LIMIT 0,1;'.format(
         phone)
     time.sleep(5)
     code = test_db.T_DB.t_db_select(self, sql, "smscode")
     params = []
     params.append(token)
     params.append(code)
     return params
    def test_queryLoanProductByListIdV2(self, name, productId, id, clientType, channelId, deviceId, dataType,
                                        hotProductSize, searchKey):
        """贷款大全"""
        userId_null = ""
        token_null = ""
        values = login.LoginByPassWord().login_by_password(int(globa_phone.phone()))
        userId = values[0]
        token = values[1]
        if name == "用户未登陆查询贷款大全成功":
            self.params = {"productId": productId, "id": id, "clientType": clientType, "channelId": channelId, "deviceId": deviceId,
              "dataType": dataType, "hotProductSize": hotProductSize, "searchKey": searchKey, "token":token_null, "userId": userId_null}
            self.result = requests.post(url=self.url, data=self.params).json()
            self.assertEqual(self.result["msg"], "ok")
            self.assertEqual(self.result['code'], '200')

        elif name == "用户登陆查询贷款大全成功":
            self.params = {"productId": productId, "id": id, "clientType": clientType, "channelId": channelId,
                  "deviceId": deviceId,
                  "dataType": dataType, "hotProductSize": hotProductSize, "searchKey": searchKey, "token": userId,
                  "userId": token}
            self.result = requests.post(url=self.url, data=self.params).json()
            self.assertEqual(self.result["msg"], "ok")
            self.assertEqual(self.result['code'], '200')