test_Key_customer_login.py 939 Bytes
import unittest
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from commons.MySession import hg,my
from commons.api.hg.transaction.Key_customer_login import Key_customer_login
kcl = Key_customer_login()

"""
大客户登录
"""

class test_Key_customer_login(unittest.TestCase):
    "大客户登录"
    @classmethod
    def setUpClass(cls):
        pass

    @unittest.case_mark(my.mark())
    def test_Key_customer_login_01(self):
        "大客户登录"
        body = kcl.body.copy()
        re = hg.post(url = kcl.url, headers = kcl.header, json = body)
        print(re.json())
        self.assertEqual(re.status_code, 200)
        self.assertTrue("'登录成功'" in str(re.json()).replace(" ", ""))
        self.assertEqual(re.json()["data"]["user"]["state"], 1,"为1时是大客户")
    @classmethod
    def tearDownClass(cls):
        pass


if __name__ == '__main__':
    unittest.main()