async def test_send_keylist_update(self):
    body = {'updates': [{'recipient_key': 'test-key0', 'action': 'add'}, {'recipient_key': 'test-key1', 'action': 'remove'}]}
    self.request.json.return_value = body
    with async_mock.patch.object(test_module.MediationRecord, 'retrieve_by_id', async_mock.CoroutineMock(return_value=async_mock.MagicMock(state=MediationRecord.STATE_GRANTED, connection_id='test-conn-id'))) as mock_retrieve_by_id, async_mock.patch.object(test_module.web, 'json_response', async_mock.MagicMock(side_effect=(lambda *args, **kwargs: [*args, *kwargs.values()]))) as mock_response:
        (results, status) = (await test_module.send_keylist_update(self.request))
        assert (results['updates'] == body['updates'])
        assert (status == 201)
async def test_send_keylist_update(self):
    body = {'updates': [{'recipient_key': 'test-key0', 'action': 'add'}, {'recipient_key': 'test-key1', 'action': 'remove'}]}
    self.request.json.return_value = body
    with async_mock.patch.object(test_module.MediationRecord, 'retrieve_by_id', async_mock.CoroutineMock(return_value=async_mock.MagicMock(state=MediationRecord.STATE_GRANTED, connection_id='test-conn-id'))) as mock_retrieve_by_id, async_mock.patch.object(test_module.web, 'json_response', async_mock.MagicMock(side_effect=(lambda *args, **kwargs: [*args, *kwargs.values()]))) as mock_response:
        (results, status) = (await test_module.send_keylist_update(self.request))
        assert (results['updates'] == body['updates'])
        assert (status == 201)