Beispiel #1
0
 def test_login_check_version(self):
     ''''''
     post_data = {'platform': '2', 'version_code': '9'}
     response = requests.get(
         "http://testapi.kitty.live/version/checkupdate", params=post_data)
     res_dict = common_check.common_check(self, response)
     exceptkeys = [
         u'notify_start', u'code', u'force', u'url', u'version_code',
         u'notify_end', u'build', u'message', u'content', u'version_name'
     ]
     common_check.common_check_dict(self, res_dict, exceptkeys, True,
                                    [u'version_name'])
Beispiel #2
0
 def test_apple(self):
     with open('session.txt', 'r') as f:
         text = (f.read())
     post_data = {'product_id': 65, 'payload': ''}
     data = json.dumps(post_data)
     url = "http://testapi.kitty.live/v1/pay/apple/create?platform=2&version_code=102"
     headers = {
         'Conten-Type': 'application/json;charset=UTF-8',
         'cookie': text
     }
     r = requests.post(url=url, data=data, headers=headers)
     res_dict = common_check.common_check(self, r)
     exceptkeys = {u'message', u'code', u'transaction_id'}
     common_check.common_check_dict(self, res_dict, exceptkeys, True, [])
     print "apple ok"
 def test_packet_live(self):
     with open('session.txt', 'r') as f:
         text = (f.read())
     params = {'live_id': 1900564}
     url = "http://testapi.kitty.live/v1/packet/live"
     headers = {
         'Conten-Type': 'application/json;charset=UTF-8',
         'cookie': text
     }
     r = requests.get(url=url, params=params, headers=headers)
     print r
     res_dict = common_check.common_check(self, r)
     exceptkeys = {u'message', u'code', u'packet'}
     common_check.common_check_dict(self, res_dict, exceptkeys, True, [])
     print "*********ok********"