Exemple #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)
Exemple #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)
Exemple #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)
Exemple #4
0
 def test_pad_empty_string(self):
     from r2.lib.tracking import _pad_message
     padded = _pad_message("")
     self.assertEquals(padded, BLOCK_O_PADDING)
Exemple #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)
Exemple #6
0
 def test_pad_empty_string(self):
     from r2.lib.tracking import _pad_message
     padded = _pad_message("")
     self.assertEquals(padded, BLOCK_O_PADDING)
Exemple #7
0
 def test_padding_roundtrip(self):
     tested = tracking._unpad_message(tracking._pad_message(MESSAGE))
     self.assertEquals(MESSAGE, tested)
Exemple #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)
Exemple #9
0
 def test_pad_empty_string(self):
     padded = tracking._pad_message("")
     self.assertEquals(padded, BLOCK_O_PADDING)