def test_should_return_rest_of_data_on_last_iteration(self): input = ['1234', '56'] result = list(s3upload.data_collector(input, def_buf_size=3)) self.assertEqual(result, ['123', '456'])
def test_a_single_item_should_still_be_buffered_even_if_it_is_above_the_buffer_size(self): input = ['123456'] result = list(s3upload.data_collector(input, def_buf_size=3)) self.assertEqual(result, ['123', '456'])
def test_should_be_able_to_read_single_yield(self): input = ['123'] result = list(s3upload.data_collector(input, def_buf_size=3)) self.assertEqual(result, ['123'])
def test_should_be_able_to_yield_data_less_than_buffer_size(self): input = ['123'] result = list(s3upload.data_collector(input, def_buf_size=6)) self.assertEqual(result, ['123'])
def test_should_be_able_to_read_every_byte_of_data(self): input = ['12345'] result = list(s3upload.data_collector(input, def_buf_size=3)) self.assertEqual(result, ['123', '45'])