Exemplo n.º 1
0
 def get_depend_key(self,depend_key,data,json_str):
     if depend_key:
         list_depend = depend_key.split()
         list_data = list_depend[0].split(',')
         for data_depend in list_data:
             data[data_depend] = OpreationGloabalVar.get_value(data_depend)
         if len(list_depend) > 1 and json_str:
             for json_depend in list_depend[1].split(','):
                 json_str[json_depend] = OpreationGloabalVar.get_value(json_depend)
Exemplo n.º 2
0
 def test_002_(self):
     datas = {
         "token": OpreationGloabalVar.get_value('token'),
         "uid": OpreationGloabalVar.get_value('uid'),
     }
     url = self.url + 'XXXXXX'
     r = requests.post(url=url, data=datas)
     self.assertEqual(r.status_code, 200)
     response = r.json()
     self.assertEqual(response['code'], '0000')
     account.get_user_headimgurl(response)
Exemplo n.º 3
0
 def test_004_downloadImg(self):
     url = self.url + 'XXXXXXX/' + OpreationGloabalVar.get_value(
         'head_img_url')
     r = requests.get(url=url, stream=True)
     f = open('a', 'wb')
     for chunk in r.iter_content(chunk_size=512):
         if chunk:
             f.write(chunk)
     f.close()
Exemplo n.º 4
0
 def test_003_(self):
     headers = {"Content-Type": "Application/json"}
     params = {"token": OpreationGloabalVar.get_value('token')}
     img_base64 = Account.get_img_base64()
     datas = {
         "": "1",
         "": Account.Unicode(),
         "": Account.Unicode(),
         "": "中国",
         "": "北京",
         "": Account.GBK2312(),
         "": OpreationGloabalVar.get_value('uid'),
         "": img_base64
     }
     url = self.url + 'XXXXXXX'
     r = requests.post(url=url, headers=headers, json=datas, params=params)
     self.assertEqual(r.status_code, 200)
     response = r.json()
     self.assertEqual(response['code'], '0000')
     print(r.json())
Exemplo n.º 5
0
 def test_003_invoice_getInvoiceList(self):
     params = {
         "token": OpreationGloabalVar.get_value('token'),
     }
     headers = {}
     url = self.url + 'XXXXXXX'
     r = requests.post(url, data=params, headers=headers)
     self.assertEqual(r.status_code, 200)
     invoice_Analyze = InvoiceListAnalyze(r.json())
     invoiceIds, trafficIds = invoice_Analyze.get_invoiceids_string()
     OpreationGloabalVar.set_value('invoiceIds', invoiceIds)
     OpreationGloabalVar.set_value('trafficIds', trafficIds)
Exemplo n.º 6
0
 def test_001_invoice_qrcheck(self):
     for invoice in config.GLOBAL_INVOICE_LIST:
         params = {
             "flag": "1",
             "token": OpreationGloabalVar.get_value('token'),
             #"infoStr": {",,031001600411,12357700,,,,"},
             "uuid": "",
         }
         url = self.url + 'XXXXXXXXX'
         r = requests.post(url, params=params)
         self.assertEqual(r.status_code, 200)
         res = r.json()
         self.assertEqual(res['code'], '0000')
         print(r.json())
Exemplo n.º 7
0
 def test_002_invoice_ocr_trafficInvoiceCollection(self):
     for traffic in config.GLOBAL_TRAFFIC_LIST:
         params = {"token": OpreationGloabalVar.get_value('token')}
         headers = {
             'Accept': "Application/json",
             'Content-Type': "application/json"
         }
         #payload = "{\r\n\"invoice_type\": \"3\",\r\n\"je\": \"35.00\",\r\n\"kprq\": \"2017-09-15 08:20:30\",\r\n\"name\": \"dachepiao\",\r\n\"train_time\": \"2017-09-15 08:20:30\",\r\n\"uuid\": \"\"\r\n}"
         payload = traffic
         url = self.url + 'XXXXXXXXX'
         r = requests.post(url,
                           params=params,
                           headers=headers,
                           json=payload)
         self.assertEqual(r.status_code, 200)
         res = r.json()
         self.assertEqual(res['code'], '0000')
         print(r.json())