Example #1
0
 def test_pad_round_string(self):
     from r2.lib.tracking import _pad_message, KEY_SIZE
     padded = _pad_message("x" * KEY_SIZE)
     self.assertEquals(len(padded), KEY_SIZE * 2)
     self.assertEquals(padded[KEY_SIZE:], BLOCK_O_PADDING)
Example #2
0
 def test_padding_roundtrip(self):
     from r2.lib.tracking import _unpad_message, _pad_message
     tested = _unpad_message(_pad_message(MESSAGE))
     self.assertEquals(MESSAGE, tested)
Example #3
0
 def test_padding_roundtrip(self):
     from r2.lib.tracking import _unpad_message, _pad_message
     tested = _unpad_message(_pad_message(MESSAGE))
     self.assertEquals(MESSAGE, tested)
Example #4
0
 def test_pad_empty_string(self):
     from r2.lib.tracking import _pad_message
     padded = _pad_message("")
     self.assertEquals(padded, BLOCK_O_PADDING)
Example #5
0
 def test_pad_round_string(self):
     from r2.lib.tracking import _pad_message, KEY_SIZE
     padded = _pad_message("x" * KEY_SIZE)
     self.assertEquals(len(padded), KEY_SIZE * 2)
     self.assertEquals(padded[KEY_SIZE:], BLOCK_O_PADDING)
Example #6
0
 def test_pad_empty_string(self):
     from r2.lib.tracking import _pad_message
     padded = _pad_message("")
     self.assertEquals(padded, BLOCK_O_PADDING)
Example #7
0
 def test_padding_roundtrip(self):
     tested = tracking._unpad_message(tracking._pad_message(MESSAGE))
     self.assertEquals(MESSAGE, tested)
Example #8
0
 def test_pad_round_string(self):
     padded = tracking._pad_message("x" * KEY_SIZE)
     self.assertEquals(len(padded), KEY_SIZE * 2)
     self.assertEquals(padded[KEY_SIZE:], BLOCK_O_PADDING)
Example #9
0
 def test_pad_empty_string(self):
     padded = tracking._pad_message("")
     self.assertEquals(padded, BLOCK_O_PADDING)