def METHOD_NAME(self):
    def mock_successful_index_documents(actions, timeout=86400):
        if len(actions) > 0:
            result = IndexingResult()
            result.key = actions[0].additional_properties.get("id")
            result.status_code = 200
            result.succeeded = True
            return [result]
    on_progress = mock.Mock()
    on_remove = mock.Mock()
    with SearchIndexingBufferedSender(
        "endpoint", "index name", CREDENTIAL, auto_flush=False, on_progress=on_progress, on_remove=on_remove
    ) as client:
        client._index_documents_actions = mock_successful_index_documents
        client._index_key = "id"
        client.upload_documents({"id": 0})
        client.flush()
        assert on_progress.called
        assert on_remove.called