예제 #1
0
 def test_should_return_rest_of_data_on_last_iteration(self):
     input = ['1234', '56']
     result = list(data_collector(input, def_buf_size=3))
     self.assertEqual(result, ['123', '456'])
예제 #2
0
 def test_should_be_able_to_yield_data_less_than_buffer_size(self):
     input = ['123']
     result = list(data_collector(input, def_buf_size=6))
     self.assertEqual(result, ['123'])
예제 #3
0
 def test_a_single_item_should_still_be_buffered_even_if_it_is_above_the_buffer_size(
         self):
     input = ['123456']
     result = list(data_collector(input, def_buf_size=3))
     self.assertEqual(result, ['123', '456'])
예제 #4
0
 def test_should_be_able_to_read_every_byte_of_data(self):
     input = ['12345']
     result = list(data_collector(input, def_buf_size=3))
     self.assertEqual(result, ['123', '45'])
예제 #5
0
 def test_should_be_able_to_read_single_yield(self):
     input = ['123']
     result = list(data_collector(input, def_buf_size=3))
     self.assertEqual(result, ['123'])
예제 #6
0
 def test_should_return_rest_of_data_on_last_iteration(self):
     input = [b'1234', b'56']
     result = list(data_collector(input, def_buf_size=3))
     self.assertEqual(result, [b'123', b'456'])
예제 #7
0
 def test_a_single_item_should_still_be_buffered_even_if_it_is_above_the_buffer_size(self):
     input = [b'123456']
     result = list(data_collector(input, def_buf_size=3))
     self.assertEqual(result, [b'123', b'456'])
예제 #8
0
 def test_should_be_able_to_yield_data_less_than_buffer_size(self):
     input = [b'123']
     result = list(data_collector(input, def_buf_size=6))
     self.assertEqual(result, [b'123'])
예제 #9
0
 def test_should_be_able_to_read_single_yield(self):
     input = [b'123']
     result = list(data_collector(input, def_buf_size=3))
     self.assertEqual(result, [b'123'])
예제 #10
0
 def test_should_be_able_to_read_every_byte_of_data(self):
     input = [b'12345']
     result = list(data_collector(input, def_buf_size=3))
     self.assertEqual(result, [b'123', b'45'])