Exemplo n.º 1
0
 def test_bad_checksum(self, raw):
     inst = SCIONUDPHeader()
     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))
Exemplo n.º 2
0
 def test_bad_length(self, raw):
     inst = SCIONUDPHeader()
     inst.total_len = 10
     # Call
     ntools.assert_raises(SCMPBadPktLen, inst.validate, range(9))