def test_request_context_send_response(self):
    queue = Queue()
    in_message = JSONRPCMessage.from_dictionary({'id': '123', 'method': 'test/text/', 'params': {}})
    rc = RequestContext(in_message, queue)
    params = {}
    rc.send_response(params)
    self.assertTrue(queue.not_empty)
    out_message = queue.get_nowait()
    self.assertIsInstance(out_message, JSONRPCMessage)
    self.assertEqual(out_message.message_type, JSONRPCMessageType.ResponseSuccess)
    self.assertEqual(out_message.message_id, '123')
    self.assertEqual(out_message.message_result, params)
def test_request_context_send_response(self):
    queue = Queue()
    in_message = JSONRPCMessage.from_dictionary({'id': '123', 'method': 'test/text/', 'params': {}})
    rc = RequestContext(in_message, queue)
    params = {}
    rc.send_response(params)
    self.assertTrue(queue.not_empty)
    out_message = queue.get_nowait()
    self.assertIsInstance(out_message, JSONRPCMessage)
    self.assertEqual(out_message.message_type, JSONRPCMessageType.ResponseSuccess)
    self.assertEqual(out_message.message_id, '123')
    self.assertEqual(out_message.message_result, params)