async def test_get_keylist(self):
    self.request.query['role'] = MediationRecord.ROLE_SERVER
    self.request.query['conn_id'] = 'test-id'
    query_results = [async_mock.MagicMock(serialize=async_mock.MagicMock(return_value={'serialized': 'route record'}))]
    with async_mock.patch.object(test_module.RouteRecord, 'query', async_mock.CoroutineMock(return_value=query_results)) as mock_query, async_mock.patch.object(self.context, 'session', async_mock.CoroutineMock()) as mock_session, async_mock.patch.object(test_module.web, 'json_response') as mock_response:
        (await test_module.get_keylist(self.request))
        mock_response.assert_called_once_with([{'serialized': 'route record'}], status=200)
        mock_query.assert_called_once_with(mock_session.return_value, {'role': MediationRecord.ROLE_SERVER, 'connection_id': 'test-id'})
async def test_get_keylist(self):
    self.request.query['role'] = MediationRecord.ROLE_SERVER
    self.request.query['conn_id'] = 'test-id'
    query_results = [async_mock.MagicMock(serialize=async_mock.MagicMock(return_value={'serialized': 'route record'}))]
    with async_mock.patch.object(test_module.RouteRecord, 'query', async_mock.CoroutineMock(return_value=query_results)) as mock_query, async_mock.patch.object(self.context, 'session', async_mock.CoroutineMock()) as mock_session, async_mock.patch.object(test_module.web, 'json_response') as mock_response:
        (await test_module.get_keylist(self.request))
        mock_response.assert_called_once_with([{'serialized': 'route record'}], status=200)
        mock_query.assert_called_once_with(mock_session.return_value, {'role': MediationRecord.ROLE_SERVER, 'connection_id': 'test-id'})