finished receive_query unit tests