예제 #1
0
 def check_verification_code():
     """
     :tips: uin = 40805092 --> 17688834313的手机号码
     :return:
     """
     # 先调用发验证码接口
     params = {'serverId': 3711, 'uin': 40805092, 'account_id': 22650705, 'user_id': 15001242, 'ip': 123456}
     params = encrypt(**params)
     Access('SendVerificationCode', **params).get()
     # 获取数据库最新的验证码
     verify_code = int(DB().get_verification_code())
     # 调用校验验证码接口
     payload = {'serverId': 3711, 'uin': 40805092, 'account_id': 22650705, 'user_id': 15001242, 'ip': 123456,
                'verify_code': verify_code}
     payload = encrypt(**payload)
     response = Access('CheckVerificationCode', **payload).get()
     return response
예제 #2
0
파일: follow.py 프로젝트: wadewow/jbg_api
 def __init__(self, api_name='FollowList'):
     """
     :param api_name: like --> 'FollowList'
     """
     self.response_list = []
     if api_name == 'FollowList':
         self.data_list = GetExcelData(api_name).post_excel_test_data()
         for i in self.data_list:
             check_point = json.loads(i.pop('check_point'))
             response = Access(api_name, **i).post()
             self.response_list.append([response, check_point])
     elif api_name in ('SetFollow', 'DisableFollow'):
         self.data_list = GetExcelData(api_name).get_excel_test_data()
         for i in self.data_list:
             check_point = json.loads(i.pop('check_point'))
             response = Access(api_name, **i).get()
             self.response_list.append([response, check_point])
예제 #3
0
 def __init__(self, api_name='GetPassSafeMobile'):
     """
     :param api_name: like --> 'GetPassSafeMobile'
     """
     self.response_list = []
     data_list = GetExcelData(api_name).get_excel_test_data()
     for i in data_list:
         check_point = json.loads(i.pop('check_point'))
         response = Access(api_name, **i).get()
         self.response_list.append([response, check_point])
예제 #4
0
파일: query.py 프로젝트: wadewow/jbg_api
 def __init__(self, api_name='QueryOrder'):
     """
     :param api_name: like --> 'QueryOrder'
     """
     self.response_list = []
     self.data_list = GetExcelData(api_name).post_excel_test_data()
     for i in self.data_list:
         check_point = json.loads(i.pop('check_point'))
         i['Param'] = json.loads(i['Param'])
         i['Pagination'] = json.loads(i['Pagination'])
         response = Access(api_name, **i).post_json()
         self.response_list.append([response, check_point])
예제 #5
0
 def setUp(self):
     # 先调用发验证码接口
     params = {
         'serverId': 3711,
         'uin': 40805092,
         'account_id': 22650705,
         'user_id': 15001242,
         'ip': 123456
     }
     params = encrypt(**params)
     Access('SendVerificationCode', **params).get()
     # 获取数据库最新的验证码
     self.verify_code = int(DB().get_verification_code())
예제 #6
0
 def test_check_verification_code_fail(self):
     """校验验证码失败"""
     payload = {
         'serverId': 3711,
         'uin': 40805092,
         'account_id': 22650705,
         'user_id': 15001242,
         'ip': 123456,
         'verify_code': 12345
     }
     payload = encrypt(**payload)
     response = Access('CheckVerificationCode', **payload).get()
     message = response['Message']
     self.assertEqual('Verification Code is not correct!', message)
예제 #7
0
    def test_2_set_21_follow_fail(self):
        """添加第21个关注失败"""

        params = {
            'o_serverid': 16,
            'o_id': 1,
            'serverid': 3711,
            'uin': 40805092,
            'account_id': 1,
            'user_id': 1,
            'ip': 1
        }
        params = encrypt(**params)
        response_code = int(
            Access('SetFollow', **params).get()['Data'].split()[-1])
        self.assertEqual(0, response_code)