填坑接口自动化-签名结果放header里

签名算法不写了,返回一个签名值

在case里面拼header,然后调方法的时候把带了签名的header放进去

mpqrc_payment_emv_yml = base.file_path + ‘/data/qrc/mpqrc_payment_emv.yml‘
@allure.feature("mpqrcPaymentEMV")
@pytest.mark.parametrize(‘data,errorcode‘,C.get_data(mpqrc_payment_emv_yml),ids=C.get_case_name(mpqrc_payment_emv_yml))
def test_mpqrc_payment_emv(self,data,errorcode):
self.header = {"Content-Type": "application/json", "UPI-JWS": self.preCard.signature(data),"INS-ID":"151525"}
res = self.preCard.mpqrc_payment_emv(self.session,data,self.header)
err = res.json()[‘msgResponse‘][‘responseCode‘]
errormsg = res.json()[‘msgResponse‘][‘responseMsg‘]
if err != ‘00‘:
allure.attach("errormsg: ", errormsg)
allure.attach("实际errorcode:", err)
assert errorcode == err

填坑接口自动化-签名结果放header里

上一篇:UVALive - 7042 The Problem to Make You Happy 博弈


下一篇:如何定位前后端问题?