test_lossCard.py 26.4 KB
#coding=utf-8

# @Time    : 2021/6/17 15:56
# @Author  : Ljq
# @File    : test_lossCard.py
# @Software: PyCharm


"""
    
"""

import unittest
import time
import commons.api.cardStorageIn as cardStorageIn
import commons.api.returnCard as returnCard
import commons.api.cardStorageOut as cardStorageOut
import commons.api.openCard as openCard
import commons.api.cardLostAndUnLost as cardLostAndUnLost
from commons.scripts.readConf import readConfig
from commons.api.doLogin import doLogin

class test_lossCardAndUn(unittest.TestCase):
    """卡片挂失,解挂测试"""
    def setUp(self) -> None:
        # 主卡入库-出库-开卡
        faceNum = 1
        self.startCardNo = int(time.strftime("%y%m%d%H%M%S", time.localtime()))
        self.endCardNo = self.startCardNo + 2
        resCardFace = cardStorageIn.getCardFace(cardHost=self.cardHost, webHeaders=self.webHeaders)
        cardFace = cardStorageIn.returnFaceValue(resCardFace=resCardFace, faceNum=faceNum)
        resSavaCard = cardStorageIn.savaCard(cardHost=self.cardHost, webHeaders=self.webHeaders,
                                             startCardNo=self.startCardNo,
                                             endCardNo=self.endCardNo, cardFace=cardFace)
        print("resSavaCard.json()  ->", resSavaCard.json())
        cardNos = str(self.startCardNo) + "," + str(self.endCardNo)
        print(cardNos)
        amount = 2
        outCardRes = cardStorageOut.cardAddOut(cardHost=self.cardHost, webHeaders=self.webHeaders, cardNos=cardNos,
                                               applyUserName=self.applyUserName, applyUserId=self.applyUserId,
                                               applyUserCode=self.applyUserCode, amount=amount)
        assert outCardRes.json()["code"] == "200", "出库失败"
        resFirstOpen = openCard.openMasterCardDef(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                  cCNum=self.cCNum, cardNo=self.startCardNo,
                                                  applyUserName=self.applyUserName)
        print("resFirstOpen", resFirstOpen.json())
        assert "200" == resFirstOpen.json()["code"], "第一次开卡,开卡失败"
        assert "data" in resFirstOpen.json(), "第一次开卡,开卡失败"
        # 副卡入库-出库-开卡
        self.startSlaveCardNo = int(time.strftime("%y%m%d%H%M%S", time.localtime()))
        self.endSlaveCardNo = self.startSlaveCardNo + 2
        resSavaCard = cardStorageIn.savaCard(cardHost=self.cardHost, webHeaders=self.webHeaders,
                                             startCardNo=self.startSlaveCardNo,
                                             endCardNo=self.endSlaveCardNo, cardType=20)
        res = openCard.checkNewCardNo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                      cardNo=self.startSlaveCardNo,
                                      cardType=20)
        assert "20000" == res.json()["code"], "使用已存在未出库的卡片进行校验校验失败"
        assert "该卡状态为[未激活],不能开卡!" == res.json()["message"], "message信息与预期信息不匹配"
        slaveCardNos = str(self.startSlaveCardNo) + "," + str(self.endSlaveCardNo)
        amount = 2
        outCardRes = cardStorageOut.cardAddOut(cardHost=self.cardHost, webHeaders=self.webHeaders, cardNos=slaveCardNos,
                                               applyUserName=self.applyUserName, applyUserId=self.applyUserId,
                                               applyUserCode=self.applyUserCode, amount=amount)
        assert outCardRes.json()["code"] == "200", "出库失败"
        resOpenSlaveCard = openCard.openSlaveCardDef(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                     cardNo=self.startCardNo, slaveCardNo=self.startSlaveCardNo,
                                                     loginPwd=self.loginPwd, applyUserName=self.applyUserName,
                                                     parentLoginPwd=self.loginPwd)
        assert "200" == resOpenSlaveCard.json()["code"], "开卡测试失败"
        # 开卡结束-获取卡片客户信息

    def tearDown(self) -> None:
        # 副卡退卡,主卡退卡
        returnCard.returnCardDef(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                 cardNo=self.startSlaveCardNo)
        returnCard.returnCardDef(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=self.startCardNo)

    @classmethod
    def setUpClass(cls) -> None:
        # 配置信息获取
        readC = readConfig()
        cls.cardHost = readC.returnOptionsItems("host", "cardHost")
        cls.gatewayHost = readC.returnOptionsItems("host", "gatewayHost")
        cls.cCNum = readC.returnOptionsItems("testInfo","cCNum")
        cls.cCNumB = readC.returnOptionsItems("testInfo", "cCNumB")
        cls.cardNum = readC.returnOptionsItems("testInfo", "cardNum")
        cls.cardNumRe = readC.returnOptionsItems("testInfo", "cardNumRe")
        cls.loginPwd = readC.returnOptionsItems("testInfo", "loginPwd")
        # 登录信息获取
        cls.webHeaders, cls.clientHeaders, cls.userInfo = doLogin().loginUser()
        cls.applyUserName = cls.userInfo["data"]["user"]["realName"]
        cls.applyUserId = cls.userInfo["data"]["user"]["id"]
        cls.applyUserCode = cls.userInfo["data"]["user"]["userName"]
        cls.firmId = cls.userInfo["data"]["user"]["firmId"]

    @classmethod
    def tearDownClass(cls) -> None:
        pass

    def test_getAccountInfo(self):
        """
        获取卡片信息测试
        :return:
        """
        # 使用未入库的卡片进行获取
        resGet = openCard.getAccountInfo(gatewayHost=self.gatewayHost,clientHeaders =self.clientHeaders,cardNo=999999999999)
        print(resGet.json())
        assert "10001" == resGet.json()["code"],"未入库卡片信息获取测试不通过"
        assert "卡账户不存在" == resGet.json()["message"],"未入库卡片信息获取测试不通过"

        # 使用入库未出库的卡片进行信息获取
        # 卡片入库
        faceNum = 1
        startCardNo = int(time.strftime("%y%m%d%H%M%S", time.localtime()))
        endCardNo = startCardNo + 2

        resCardFace = cardStorageIn.getCardFace(cardHost=self.cardHost, webHeaders=self.webHeaders)
        cardFace = cardStorageIn.returnFaceValue(resCardFace=resCardFace, faceNum=faceNum)
        resSavaCard = cardStorageIn.savaCard(cardHost=self.cardHost, webHeaders=self.webHeaders, startCardNo=startCardNo,
                                   endCardNo=endCardNo, cardFace=cardFace)
        resGet = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=startCardNo)
        print(resGet.json())
        assert "10001" == resGet.json()["code"], "未出库卡片信息获取测试不通过"
        assert "卡账户不存在" == resGet.json()["message"], "未出库卡片信息获取测试不通过"

        # 使用出库未开卡的卡片进行信息获取
        cardNos = str(startCardNo) + "," + str(endCardNo)
        amount = len([i for i in range(startCardNo, endCardNo + 1)])
        outCardRes = cardStorageOut.cardAddOut(cardHost=self.cardHost, webHeaders=self.webHeaders, cardNos=cardNos,
                                    applyUserName=self.applyUserName, applyUserId=self.applyUserId,
                                    applyUserCode=self.applyUserCode, amount=amount)
        assert outCardRes.json()["code"] == "200", "出库失败"
        resGet = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=startCardNo)
        print(resGet.json())
        assert "10001" == resGet.json()["code"], "未出库卡片信息获取测试不通过"
        assert "卡账户不存在" == resGet.json()["message"], "未出库卡片信息获取测试不通过"

        # 使用已开卡的卡片可以正确的获取到客户信息
        resFirstOpen = openCard.openMasterCardDef(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                             cCNum=self.cCNum, cardNo=startCardNo, applyUserName=self.applyUserName)
        assert "200" == resFirstOpen.json()["code"], "开卡失败"
        assert "data" in resFirstOpen.json(), "开卡失败"
        resGet = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=startCardNo)
        # print("resGet.json()",resGet.json())
        assert "200" == resGet.json()["code"], "已开卡卡片信息获取测试不通过"
        assert "data" in resGet.json(), "已开卡卡片信息获取测试不通过"

        # 使用已挂失的卡片信息进行卡片信息获取
        accountId,customerId = resGet.json()["data"]["accountId"],resGet.json()["data"]["customerId"]
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=str(startCardNo),
                                     accountId=accountId, customerId=customerId, loginPwd=self.loginPwd)
        # print("resLossCard.json()",resLossCard.json())
        assert "200" == resLossCard.json()["code"],"已挂失的卡片获取卡片信息测试不通过"
        resGet = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=startCardNo)
        # print("resGet.json()", resGet.json())
        assert "2000" == resGet.json()["code"], "未出库卡片信息获取测试不通过"
        assert "该卡为挂失状态,不能进行此操作" == resGet.json()["message"], "未出库卡片信息获取测试不通过"
        # 解挂
        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=str(startCardNo),
                                     accountId=accountId, customerId=customerId, loginPwd=self.loginPwd)
        # print("resUnLoss.json()",resUnLoss.json())

        # 账号冻结状态

        # 卡片锁定状态

        # 使用已退还的卡片进行卡片信息获取
        returnCard.returnCardDef(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=startCardNo)
        resGet = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=startCardNo)
        # print("resGet.json()", resGet.json())
        assert "2000" == resGet.json()["code"], "已退还的卡片信息获取测试不通过"
        assert "该卡为退还状态,不能进行此操作" == resGet.json()["message"], "已退还的卡片信息获取测试不通过"


    def test_lossCardAndUnLost(self):
        """卡片挂失"""
        # 获取卡片客户信息
        accountInfo = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=self.startCardNo)
        accountId,customerId = accountInfo.json()["data"]["accountId"],accountInfo.json()["data"]["customerId"]
        slaveCardAccountInfo = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders, cardNo=self.startSlaveCardNo)
        print("slaveCardAccountInfo  ",slaveCardAccountInfo.json())
        customerIdSlaveCard, accountIdSlaveCard = slaveCardAccountInfo.json()["data"]["customerId"], slaveCardAccountInfo.json()["data"]["accountId"]
        # 以上为测试数据准备

        """开始测试"""
        # 正常主卡卡片挂失解挂
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo),accountId=accountId, customerId=customerId,
                                                 loginPwd=self.loginPwd)
        assert "200" == resLossCard.json()["code"],"卡片挂失失败"
        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId, customerId=customerId,
                                                 loginPwd=self.loginPwd)
        assert "200" == resUnLoss.json()["code"],"卡片解挂失败"


        # 正常副卡卡片挂失解挂
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startSlaveCardNo),accountId=accountIdSlaveCard,
                                                 customerId=customerIdSlaveCard,
                                                 loginPwd=self.loginPwd)
        assert "200" == resLossCard.json()["code"],"副卡挂失失败"
        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startSlaveCardNo), accountId=accountIdSlaveCard,
                                                 customerId=customerIdSlaveCard,
                                                 loginPwd=self.loginPwd)
        assert "200" == resUnLoss.json()["code"], "副卡解挂失败"

        """测试完成"""

    def test_lossCardError(self):
        """挂失卡片异常情况"""
        # 卡账户信息准备
        accountInfo = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                              cardNo=self.startCardNo)
        accountId, customerId = accountInfo.json()["data"]["accountId"], accountInfo.json()["data"]["customerId"]
        slaveCardAccountInfo = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                       cardNo=self.startSlaveCardNo)
        print("slaveCardAccountInfo  ", slaveCardAccountInfo.json())
        customerIdSlaveCard, accountIdSlaveCard = slaveCardAccountInfo.json()["data"]["customerId"], \
                                                  slaveCardAccountInfo.json()["data"]["accountId"]
        # 以上为测试数据准备

        """开始测试"""
        # 密码长度不满足六位数字时挂失失败
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId, customerId=customerId,
                                                 loginPwd="1111111")
        assert "1000" == resLossCard.json()["code"], "密码长度超过六位的错误验证测试不通过"
        assert "密码必须6位" == resLossCard.json()["message"], "密码长度超过六位的错误验证测试不通过"
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId, customerId=customerId,
                                                 loginPwd="11111")
        assert "1000" == resLossCard.json()["code"], "密码长度不足六位的错误验证测试不通过"
        assert "密码必须6位" == resLossCard.json()["message"], "密码长度不足六位的错误验证测试不通过"

        # 密码错误挂失失败
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId, customerId=customerId,
                                                 loginPwd="123890")
        assert "10001" == resLossCard.json()["code"], "密码错误挂失失败测试不通过"
        assert "密码输入有误" == resLossCard.json()["message"], "密码错误挂失失败测试不通过"


        # 主卡挂失后,副卡不可以再进行挂失
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId, customerId=customerId,
                                                 loginPwd=self.loginPwd)
        assert "200" == resLossCard.json()["code"], "卡片挂失失败"
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startSlaveCardNo), accountId=accountIdSlaveCard,
                                                 customerId=customerIdSlaveCard,
                                                 loginPwd=self.loginPwd)
        assert "2000" == resLossCard.json()["code"], "主卡挂失后副卡不能挂失测试失败"
        assert f"该卡的主卡【{self.startCardNo}】为挂失状态,不能进行此操作" == resLossCard.json()["message"], "主卡挂失后副卡不能挂失测试失败"
        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId, customerId=customerId,
                                                 loginPwd=self.loginPwd)
        assert "200" == resUnLoss.json()["code"], "卡片解挂失败"
        """测试完成"""

    def test_getByCardForUnLost(self):
        """挂失卡片信息信息"""
        # 卡账户信息准备
        accountInfo = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                              cardNo=self.startCardNo)
        accountId, customerId = accountInfo.json()["data"]["accountId"], accountInfo.json()["data"]["customerId"]
        slaveCardAccountInfo = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                       cardNo=self.startSlaveCardNo)
        print("slaveCardAccountInfo  ", slaveCardAccountInfo.json())
        customerIdSlaveCard, accountIdSlaveCard = slaveCardAccountInfo.json()["data"]["customerId"], \
                                                  slaveCardAccountInfo.json()["data"]["accountId"]
        # 以上为测试数据准备

        """开始测试"""

        # 使用状态正常的卡片进行信息获取
        resGetByCard = cardLostAndUnLost.getByCardForUnLost(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                       cardNo=self.startCardNo)
        print(resGetByCard.json())
        assert "2000" == resGetByCard.json()["code"],"状态正常的卡片用户信息获取测试不通过"
        assert "该卡为正常状态,不能进行此操作" == resGetByCard.json()["message"],"状态正常的卡片用户信息获取测试不通过"

        # 已挂失的卡片可以成功获取到卡片信息
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId, customerId=customerId,
                                                 loginPwd=self.loginPwd)
        assert "200" == resLossCard.json()["code"], "卡片挂失失败"

        resGetByCard = cardLostAndUnLost.getByCardForUnLost(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                       cardNo=self.startCardNo)
        print(resGetByCard.json())
        assert "200" == resGetByCard.json()["code"],"已挂失的卡片可以成功获取到卡片信息测试不通过"
        assert f"{accountId}" in resGetByCard.text,"已挂失的卡片可以成功获取到卡片信息测试不通过"

        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId, customerId=customerId,
                                                 loginPwd=self.loginPwd)
        assert "200" == resUnLoss.json()["code"], "卡片解挂失败"

        # 未开卡的卡片获取信息验证
        resGetByCard = cardLostAndUnLost.getByCardForUnLost(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                       cardNo="999999999999")
        print(resGetByCard.json())
        assert "10001" == resGetByCard.json()["code"],"未开卡的卡片获取信息验证测试不通过"
        assert "卡账户不存在" == resGetByCard.json()["message"],"未开卡的卡片获取信息验证测试不通过"

        # 副卡挂失操作异常操作
        print("开始副卡挂失异常操作")

        # 使用状态正常的副卡进行信息获取
        resGetByCard = cardLostAndUnLost.getByCardForUnLost(gatewayHost=self.gatewayHost,
                                                            clientHeaders=self.clientHeaders,
                                                            cardNo=self.startSlaveCardNo)
        print(resGetByCard.json())
        assert "2000" == resGetByCard.json()["code"], "状态正常的副卡用户信息获取测试不通过"
        assert "该卡为正常状态,不能进行此操作" == resGetByCard.json()["message"], "状态正常的副卡用户信息获取测试不通过"

        # 已挂失的副卡可以正常查询
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startSlaveCardNo), accountId=accountIdSlaveCard,
                                                 customerId=customerIdSlaveCard,
                                                 loginPwd=self.loginPwd)
        assert "200" == resLossCard.json()["code"], "副卡挂失失败"
        resGetByCard = cardLostAndUnLost.getByCardForUnLost(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                       cardNo=self.startSlaveCardNo)
        assert "200" == resGetByCard.json()["code"],"已挂失的副卡可以正常查询测试不通过"
        assert f"{accountId}" in resGetByCard.text,"已挂失的副卡可以正常查询测试不通过"

        # 副卡解挂
        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startSlaveCardNo), accountId=accountIdSlaveCard,
                                                 customerId=customerIdSlaveCard,
                                                 loginPwd=self.loginPwd)
        assert "200" == resUnLoss.json()["code"], "副卡解挂失败"
        """测试完成"""


    def test_unLostError(self):
        """卡片异常解挂"""
        # 卡账户信息准备
        accountInfo = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                              cardNo=self.startCardNo)
        accountId, customerId = accountInfo.json()["data"]["accountId"], accountInfo.json()["data"]["customerId"]
        slaveCardAccountInfo = openCard.getAccountInfo(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                       cardNo=self.startSlaveCardNo)
        print("slaveCardAccountInfo  ", slaveCardAccountInfo.json())
        customerIdSlaveCard, accountIdSlaveCard = slaveCardAccountInfo.json()["data"]["customerId"], \
                                                  slaveCardAccountInfo.json()["data"]["accountId"]
        resLossCard = cardLostAndUnLost.lossCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId,
                                                 customerId=customerId,
                                                 loginPwd=self.loginPwd)
        assert "200" == resLossCard.json()["code"], "卡片挂失失败"
        resGetByCard = cardLostAndUnLost.getByCardForUnLost(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                       cardNo=self.startCardNo)
        assert "200" == resGetByCard.json()["code"],"已挂失的卡片可以成功获取到卡片信息测试不通过"

        """开始测试"""
        # 使用错误的密码进行解挂
        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId,
                                                 customerId=customerId,
                                                 loginPwd="123890")
        print("resUnLoss",resUnLoss.json())
        assert "10001" == resUnLoss.json()["code"], "使用错误的密码解挂失败测试不通过"
        assert "密码输入有误" == resUnLoss.json()["message"], "使用错误的密码解挂失败测试不通过"

        # 小于六位的密码进行解挂
        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId,
                                                 customerId=customerId,
                                                 loginPwd="123")
        print("resUnLoss",resUnLoss.json())
        assert "10001" == resUnLoss.json()["code"], "小于六位的密码进行解挂失败测试不通过"
        assert "密码输入有误" == resUnLoss.json()["message"], "小于六位的密码进行解挂失败测试不通过"

        # 大于六位的密码进行解挂
        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId,
                                                 customerId=customerId,
                                                 loginPwd="123111123")
        print("resUnLoss", resUnLoss.json())
        assert "10001" == resUnLoss.json()["code"], "大于六位的密码进行解挂失败测试不通过"
        assert "密码输入有误" == resUnLoss.json()["message"], "大于六位的密码进行解挂失败测试不通过"
        """解挂时未进行密码长度验证"""

        resUnLoss = cardLostAndUnLost.unLostCard(gatewayHost=self.gatewayHost, clientHeaders=self.clientHeaders,
                                                 cardNo=str(self.startCardNo), accountId=accountId,
                                                 customerId=customerId,
                                                 loginPwd=self.loginPwd)
        """测试完成"""