test handle_read and handle_write