fc_add.py
968 Bytes
import unittest
import urllib3
from commons import common as com
from commons.MySession import my
from commons.api.fc_add import fc_add
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
fc=fc_add()
class test_fc_add(unittest.TestCase):
"新增返还人"
@classmethod
def setUpClass(cls):
my.post(url=fc.url, headers=fc.header, data=fc.body.encode('utf-8'))
def test_fc_add_01(self):
body = fc.body.replace("888810054630","888810054630").replace("你好","克萨斯").replace("relation\
CardTemp=888810054630","relationCardTemp=888810054630").replace("relationalCard[0].cardNumber=888\
810054630","relationalCard[0].cardNumber=888810054630")
print(body)
re = my.post(url=fc.url, headers=fc.header, data=body.encode('utf-8'))
print(re.headers)
print(re.json())
self.assertTrue("操作成功" in str(re.json()))
if __name__ == '__main__':
unittest.main()