def test_rle_encode(self): actual = compress.rle_encode( '#########....#.###.#.#.##..#...#########') self.assertEqual('9#4.1#1.3#1.1#1.1#1.2#2.1#3.9#', actual)
def test_rle_encode_single_multiple_digits(self): self.assertEqual('412a122b111b', compress.rle_encode('1111aa2bb1b'))
def test_rle_encode_input(self): self.assertEqual('3a1b4c2C1a1B', compress.rle_encode('aaabccccCCaB'))
def test_rle_encode_single_char(self): self.assertEqual('111a', compress.rle_encode('1a'))
def test_rle_encode_nonletter(self): self.assertEqual('1a1b1 1b', compress.rle_encode('ab b')) self.assertEqual('1a2b', compress.rle_encode('abb\0\0'))