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]
def mock_fail_index_documents(actions, timeout=86400): if len(actions) > 0: result = IndexingResult() result.key = actions[0].additional_properties.get('id') result.status_code = 400 result.succeeded = False self.uploaded = self.uploaded + len(actions) - 1 return [result]