def test_encode_lowercase_characters(self):
     self.assertMultiLineEqual(encode('aabbbcccc'), '2a3b4c')
 def test_encode_single_characters_only_are_encoded_without_count(self):
     self.assertMultiLineEqual(encode('XYZ'), 'XYZ')
 def test_encode_single_characters_mixed_with_repeated_characters(self):
     self.assertMultiLineEqual(
         encode('WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB'),
         '12WB12W3B24WB')
Ejemplo n.º 4
0
 def test_encode_lowercase_characters(self):
     assert encode("aabbbcccc") == "2a3b4c"
Ejemplo n.º 5
0
 def test_encode_followed_by_decode_gives_original_string(self):
     assert decode(encode("zzz ZZ  zZ")) == "zzz ZZ  zZ"
 def test_encode_single_characters_mixed_with_repeated_characters(self):
     self.assertMultiLineEqual(
         encode("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"),
         "12WB12W3B24WB",
     )
Ejemplo n.º 7
0
 def test_encode_unicode_s(self):
     self.assertMultiLineEqual('⏰3⚽2⭐⏰', encode('⏰⚽⚽⚽⭐⭐⏰'))
 def test_encode_string_with_no_single_characters(self):
     self.assertEqual(encode('AABBBCCCC'), '2A3B4C')
 def test_encode_single_characters_mixed_with_repeated_characters(self):
     self.assertEqual(
         encode('WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB'),
         '12WB12W3B24WB')
Ejemplo n.º 10
0
 def test_encode_empty_string(self):
     self.assertMultiLineEqual('', encode(''))
 def test_encode_single_characters_only_are_encoded_without_count(self):
     self.assertEqual(encode('XYZ'), 'XYZ')
Ejemplo n.º 12
0
 def test_encode_multiple_whitespace_mixed_in_string(self):
     self.assertMultiLineEqual('2 hs2q q2w2 ', encode('  hsqq qww  '))
Ejemplo n.º 13
0
 def test_encode_string_with_no_single_characters(self):
     self.assertMultiLineEqual('2A3B4C', encode('AABBBCCCC'))
Ejemplo n.º 14
0
 def test_encode(self):
     self.assertMultiLineEqual('2A3B4C', encode('AABBBCCCC'))
Ejemplo n.º 15
0
 def test_encode_empty_string(self):
     self.assertMultiLineEqual(encode(''), '')
 def test_encode_multiple_whitespace_mixed_in_string(self):
     self.assertEqual(encode('  hsqq qww  '), '2 hs2q q2w2 ')
 def test_encode_single_characters_only_are_encoded_without_count(self):
     self.assertMultiLineEqual(encode("XYZ"), "XYZ")
 def test_encode_empty_string(self):
     self.assertEqual(encode(''), '')
 def test_encode_lowercase_characters(self):
     self.assertMultiLineEqual(encode("aabbbcccc"), "2a3b4c")
Ejemplo n.º 20
0
def test_A_should_return_A1():
    entrada = "A"
    saida_desejada = "A1"

    assert saida_desejada == encode(entrada)
Ejemplo n.º 21
0
 def test_encode_multiple_whitespace_mixed_in_string(self):
     assert encode("  hsqq qww  ") == "2 hs2q q2w2 "
Ejemplo n.º 22
0
def test_AAAAAABBC_should_return_A6B2C1():
    entrada = "AAAAAABBC"
    saida_desejada = "A6B2C1"

    assert saida_desejada == encode(entrada)
Ejemplo n.º 23
0
 def test_encode_empty_string(self):
     assert encode("") == ""
Ejemplo n.º 24
0
def test_AABBCC_should_return_A2B2C2():
    entrada = "AABBCC"
    saida_desejada = "A2B2C2"

    assert saida_desejada == encode(entrada)
Ejemplo n.º 25
0
 def test_encode_single_characters_only_are_encoded_without_count(self):
     assert encode("XYZ") == "XYZ"
Ejemplo n.º 26
0
 def test_encode_single_character(self):
     self.assertMultiLineEqual(encode('a'), 'a')
Ejemplo n.º 27
0
 def test_encode_string_with_no_single_characters(self):
     self.assertMultiLineEqual(encode('AABBBCCCC'), '2A3B4C')
Ejemplo n.º 28
0
 def test_encoding_string_with_a_broken_run(self):
     self.assertMultiLineEqual(encode('AABBBCCCCA'), '2A3B4CA')
Ejemplo n.º 29
0
 def test_encode_multiple_whitespace_mixed_in_string(self):
     self.assertMultiLineEqual(encode('  hsqq qww  '), '2 hs2q q2w2 ')
Ejemplo n.º 30
0
 def test_encode_lowercase_characters(self):
     self.assertMultiLineEqual(encode('aabbbcccc'), '2a3b4c')
Ejemplo n.º 31
0
 def test_combination(self):
     self.assertMultiLineEqual(decode(encode('zzz ZZ  zZ')), 'zzz ZZ  zZ')
Ejemplo n.º 32
0
 def test_combination(self):
     self.assertMultiLineEqual(decode(encode('zzz ZZ  zZ')), 'zzz ZZ  zZ')
 def test_encode_empty_string(self):
     self.assertMultiLineEqual(encode(""), "")
Ejemplo n.º 34
0
 def test_encode_none(self):
     self.assertEqual(encode(None), '')
 def test_encode_string_with_no_single_characters(self):
     self.assertMultiLineEqual(encode("AABBBCCCC"), "2A3B4C")
Ejemplo n.º 36
0
 def test_encode_string_with_no_single_characters(self):
     assert encode("AABBBCCCC") == "2A3B4C"
 def test_encode_multiple_whitespace_mixed_in_string(self):
     self.assertMultiLineEqual(encode("  hsqq qww  "), "2 hs2q q2w2 ")
Ejemplo n.º 38
0
 def test_encode_single_characters_mixed_with_repeated_characters(self):
     assert (
         encode("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB")
         == "12WB12W3B24WB"
     )
 def test_encode_followed_by_decode_gives_original_string(self):
     self.assertMultiLineEqual(decode(encode("zzz ZZ  zZ")), "zzz ZZ  zZ")
Ejemplo n.º 40
0
 def test_encode_with_single(self):
     self.assertMultiLineEqual(
         '12WB12W3B24WB',
         encode('WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB'))