def test_bad_checksum(self, raw): inst = SCMPHeader() inst.total_len = 10 + inst.LEN inst._calc_checksum = create_mock() inst._calc_checksum.return_value = bytes.fromhex("8888") inst._checksum = bytes.fromhex("9999") # Call ntools.assert_raises(SCIONChecksumFailed, inst.validate, range(10))
def test_bad_length(self, raw): inst = SCMPHeader() inst.total_len = 10 # Call ntools.assert_raises(SCMPBadPktLen, inst.validate, range(9))