def test_arqc_req_payment(self): # Payment of £1234.56, account number of 78901234 req = get_arqc_req(TLV.unmarshal(APP_DATA)[0x70], value=1234.56, challenge=78901234) data = unformat_bytes('''80 AE 80 00 1D 00 00 00 12 34 56 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 01 01 01 00 78 90 12 34 00''') self.assertEqual(req.marshal(), data) # Payment of £15.00, account number of 78901234 req = get_arqc_req(TLV.unmarshal(APP_DATA)[0x70], value=15.00, challenge=78901234) data = unformat_bytes('''80 AE 80 00 1D 00 00 00 00 15 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 01 01 01 00 78 90 12 34 00''') self.assertEqual(req.marshal(), data)
def test_arqc_req_challenge(self): # Challenge of 78901234 req = get_arqc_req(TLV.unmarshal(APP_DATA)[0x70], challenge=78901234) data = unformat_bytes( '''80 AE 80 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 01 01 01 00 78 90 12 34 00''') self.assertEqual(req.marshal(), data)
def test_arqc_req(self): # Comparing with a valid test request from barclays_pinsentry.c req = get_arqc_req(TLV.unmarshal(APP_DATA)[0x70]) data = unformat_bytes( '''80 AE 80 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 01 01 01 00 00 00 00 00 00''') self.assertEqual(req.marshal(), data)
def test_arqc_req_challenge(): # Challenge of 78901234 req = get_arqc_req(TLV.unmarshal(APP_DATA)[0x70], challenge=78901234) data = unformat_bytes( """80 AE 80 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 01 01 01 00 78 90 12 34 00""") assert req.marshal() == data
def test_arqc_req(): # Comparing with a valid test request from barclays_pinsentry.c req = get_arqc_req(TLV.unmarshal(APP_DATA)[0x70]) data = unformat_bytes( """80 AE 80 00 1D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 01 01 01 00 00 00 00 00 00""") assert req.marshal() == data
def test_arqc_req_payment(): # Payment of £1234.56, account number of 78901234 req = get_arqc_req(TLV.unmarshal(APP_DATA)[0x70], value=1234.56, challenge=78901234) data = unformat_bytes( """80 AE 80 00 1D 00 00 00 12 34 56 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 01 01 01 00 78 90 12 34 00""") assert req.marshal() == data # Payment of £15.00, account number of 78901234 req = get_arqc_req(TLV.unmarshal(APP_DATA)[0x70], value=15.00, challenge=78901234) data = unformat_bytes( """80 AE 80 00 1D 00 00 00 00 15 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 01 01 01 00 78 90 12 34 00""") assert req.marshal() == data