'Verify that handle_read() processes incomplete messages properly.'

def test_handle_read__incomplete(self):

    self.obj_ut.process_msg = Mock()
    self.assertEqual(self.obj_ut._iobuf.getvalue(), '')
    self.obj_ut._iobuf.write('\x84\x00\x00\x00\x00')
    self.obj_ut.handle_read()
    self.assertEqual(self.obj_ut._iobuf.getvalue(), '\x84\x00\x00\x00\x00')
    self.obj_ut._iobuf.write('\x00\x00\x00\x15')
    self.obj_ut.handle_read()
    self.assertEqual(self.obj_ut._iobuf.getvalue(), '\x84\x00\x00\x00\x00\x00\x00\x00\x15')
    self.assertEqual(self.obj_ut._current_frame.end_pos, 30)
    self.assertFalse(self.obj_ut.process_msg.called)
