def test_09(self): long_text = 'A very, very, very, very, very, very, very, ' \ 'very, very, very, very, very, very, very, very, very, very, long text!' text_len = len(long_text) my_res = split_to_messages(long_text, 2**(text_len * 7)) cor_res = [ long_text, ] print(f'Out[9]: {my_res}') self.assertEqual(my_res, cor_res)
def test_08(self): my_res = split_to_messages( 'A very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, long text!', 2**(10 * 7) - 1) cor_res = [ 'A very, v', 'ery, very', ', very, v', 'ery, very', ', very, v', 'ery, very', ', very, v', 'ery, very', ', very, v', 'ery, very', ', long te', 'xt! ' ] print(f'Out[8]: {my_res}') self.assertEqual(my_res, cor_res)
def test_00(self): my_res = split_to_messages('a', 2**7) cor_res = list('a') print(f'Out[0]: {my_res}') self.assertEqual(my_res, cor_res)
def test_07(self): my_res = split_to_messages('Hello World!', 2**(10 * 7) - 1) cor_res = ['Hello Wor', 'ld! '] print(f'Out[7]: {my_res}') self.assertEqual(my_res, cor_res)
def test_05(self): my_res = split_to_messages('abc ', 2**10, char_bit_len=5) cor_res = ['ab', 'c '] print(f'Out[5]: {my_res}') self.assertEqual(my_res, cor_res)
def test_04(self): my_res = split_to_messages('abcd', 2**14) cor_res = ['ab', 'cd'] print(f'Out[4]: {my_res}') self.assertEqual(my_res, cor_res)
def test_03(self): my_res = split_to_messages('abcxyz!', 2**6, char_bit_len=6) cor_res = list('abcxyz!') print(f'Out[3]: {my_res}') self.assertEqual(my_res, cor_res)
def test_02(self): my_res = split_to_messages('abcxyz!', 2**8 - 1) cor_res = list('abcxyz!') print(f'Out[2]: {my_res}') self.assertEqual(my_res, cor_res)