Commit 8c5894caf56cb8aabd828d34412456c6f30ff5a9

Authored by wenleiming
1 parent d2e4b51b

修改返还人

commons/api/fc_add.py
... ... @@ -29,8 +29,8 @@ class fc_add():
29 29 self.body = fc_add.body
30 30  
31 31  
32   -fc=fc_add()
33   -print(fc.body)
34   -re=my.post(url=fc.url,data=fc.body.encode('utf-8'),headers=fc.header)
35   -print(re.json())
36   -print(re.headers)
37 32 \ No newline at end of file
  33 +# fc=fc_add()
  34 +# print(fc.body)
  35 +# re=my.post(url=fc.url,data=fc.body.encode('utf-8'),headers=fc.header)
  36 +# print(re.json())
  37 +# print(re.headers)
38 38 \ No newline at end of file
... ...
commons/api/fc_edit.py
... ... @@ -5,3 +5,35 @@
5 5 @File :fc_edit.py
6 6 @IDE :PyCharm
7 7 """
  8 +from commons import common as com
  9 +from commons.MySession import my
  10 +
  11 +class fc_edit():
  12 + url = "http://test.jmsf.diligrp.com:8385/FeedbackCustomerController/add.action"
  13 +
  14 + header = {
  15 + "Host": "test.jmsf.diligrp.com:8385", "Connection": "keep-alive", "Content-Length": "148",
  16 + "Accept": "application/json,text/javascript,*/*;q=0.01", "Origin": "http://test.jmsf.diligrp.com:8385",
  17 + "X-Requested-With": "XMLHttpRequest",
  18 + "User-Agent": "Mozilla/5.0(WindowsNT6.2;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/84.0.4147.105Safari/537.36",
  19 + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", "Accept-Language": "zh-CN,zh;q=0.9",
  20 + "Referer": "http://test.jmsf.diligrp.com:8385/FeedbackCustomerController/list",
  21 + "Accept-Encoding": "gzip,deflate",
  22 + "Cookie": "UAP_refreshToken=0e205e78-a656-4a85-a2ba-7226ce898ae5;\
  23 + UAP_firmId=9;\
  24 + UAP_accessToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJXRUIiLCJuYmYiOjE2Mjc4NzAyMzUsImRhdGEiOiJ7XCJjZWxscGhvbmVcIjpcIjE1NTI2MzY0NDU2XCIsXCJjcmVhdGVkXCI6MTYwODc5NTk0OTAwMCxcImRlcGFydG1lbnRJZFwiOjU2LFwiZW1haWxcIjpcInNoZW55YW5nQGRpbGlncnAuY29tXCIsXCJmaXJtQ29kZVwiOlwic3lcIixcImZpcm1JZFwiOjksXCJmaXJtTmFtZVwiOlwi5rKI6Ziz5Zyw5Yip5Yac5om55biC5Zy65a6i5oi355S15a2Q57uT566X5Lit5b-DXCIsXCJpZFwiOjI1MSxcImxhc3RMb2dpblRpbWVcIjoxNjI3ODY1NTc3OTg5LFwibWV0YWRhdGFcIjp7fSxcIm1vZGlmaWVkXCI6MTYyNjE2MzAwNDAwMCxcInBhc3N3b3JkXCI6XCIxODk2NUVCNzJDOTJBNTQ5RERcIixcInJlYWxOYW1lXCI6XCLmsojpmLNcIixcInNlcmlhbE51bWJlclwiOlwiMDAwXCIsXCJzdGF0ZVwiOjEsXCJzeXN0ZW1UeXBlXCI6MSxcInVzZXJOYW1lXCI6XCI0NDQ0NDRcIn0iLCJpc3MiOiJVQVBfQVVUSDAiLCJleHAiOjE2Mjc4NzIwMzUsImlhdCI6MTYyNzg3MDIzNSwianRpIjoiNDc3MDU5N2YtMGRjZi00OGIwLTg5YjQtNmVhODFiZjVhNTJjIn0.nso2DlyjXlOnwFp5D-N9jvyEKHJJ76K-BIzTdT-1UQAbqKD_9m4ZKXESxh-9333GWtYHORsnbav6MXI6h1Si4Ee_6rxB1DrkqxXoohavvAPutNr5byXjIUejLfFv_YTyCuXCkjiSCUlribURiqG_jKccr5BfIVUigSLkB9ff3f4"
  25 + }
  26 +
  27 + body = "id=40&name=农交&mobile=18828281176&cardNumber=888810054630&\
  28 + relationCardTemp=210720133001&relationalCard[0].cardNumber=210720131533"
  29 +
  30 + def __init__(self):
  31 + self.url = fc_edit.url.replace("http://test.",com.get_global_config("global_data", "environment", "en") )
  32 + self.header = fc_edit.header
  33 + self.body = fc_edit.body
  34 +
  35 +fc=fc_edit()
  36 +print(fc.body)
  37 +re=my.post(url=fc.url,data=fc.body.encode('utf-8'),headers=fc.header)
  38 +print(re.json())
  39 +print(re.headers)
8 40 \ No newline at end of file
... ...
testcase/fc_add.py renamed to testcase/fc_add/fc_add.py
... ... @@ -15,14 +15,17 @@ class test_fc_add(unittest.TestCase):
15 15 def test_fc_add_01(self):
16 16  
17 17 body = fc.body.replace("888810054630","888810054630").replace("你好","克萨斯").replace("relation\
18   - CardTemp=888810054630","relationCardTemp=888810054630").replace("relationalCard[0].cardNumber=888\
19   - 810054630","relationalCard[0].cardNumber=888810054630")
  18 + CardTemp=888810054630","relationCardTemp=888810054630").replace("relationalCard[0].cardNumber\
  19 + =888810054630","relationalCard[0].cardNumber=888810054630")
20 20 print(body)
21 21 re = my.post(url=fc.url, headers=fc.header, data=body.encode('utf-8'))
22 22 print(re.headers)
23 23 print(re.json())
24 24 self.assertTrue("操作成功" in str(re.json()))
25 25  
  26 + @classmethod
  27 + def tearDownClass(cls):
  28 + pass
26 29  
27 30  
28 31 if __name__ == '__main__':
... ...
testcase/fc_edit/fc_add.py 0 → 100644
  1 +import unittest
  2 +import urllib3
  3 +from commons import common as com
  4 +from commons.MySession import my
  5 +from commons.api.fc_edit import fc_edit
  6 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  7 +
  8 +fc=fc_edit()
  9 +class test_fc_edit(unittest.TestCase):
  10 + "修改返还人"
  11 + @classmethod
  12 + def setUpClass(cls):
  13 + my.post(url=fc.url, headers=fc.header, data=fc.body.encode('utf-8'))
  14 +
  15 + def test_fc_edit_01(self):
  16 +
  17 + body = fc.body.replace("relationalCard[0].cardNumber=210720131533",\
  18 + "relationalCard[0].cardNumber=210720125142")
  19 + print(body)
  20 + re = my.post(url=fc.url, headers=fc.header, data=body.encode('utf-8'))
  21 + print(re.headers)
  22 + print(re.json())
  23 + self.assertTrue("操作成功" in str(re.json()))
  24 +
  25 + @classmethod
  26 + def tearDownClass(cls):
  27 + pass
  28 +
  29 +
  30 +if __name__ == '__main__':
  31 + unittest.main()
... ...