def test_unpad_evil_message(self): from r2.lib.tracking import _unpad_message evil = ("a" * 88) + chr(57) result = _unpad_message(evil) self.assertEquals(result, "")
def test_padding_roundtrip(self): from r2.lib.tracking import _unpad_message, _pad_message tested = _unpad_message(_pad_message(MESSAGE)) self.assertEquals(MESSAGE, tested)
def test_unpad_empty_message(self): from r2.lib.tracking import _unpad_message unpadded = _unpad_message("") self.assertEquals(unpadded, "")
def test_padding_roundtrip(self): tested = tracking._unpad_message(tracking._pad_message(MESSAGE)) self.assertEquals(MESSAGE, tested)
def test_unpad_evil_message(self): evil = ("a" * 88) + chr(57) result = tracking._unpad_message(evil) self.assertEquals(result, "")
def test_unpad_empty_message(self): unpadded = tracking._unpad_message("") self.assertEquals(unpadded, "")