def setUp(self): super(TestsCursor, self).setUp() self.c = self.conn.collection.test self.cursor = lambda *args, **kwargs: Cursor(self.conn, *args, **kwargs ) logger.info("Creating collection `test`") self.c.create()
def __iter__(self): """Iterate through the documents in the collection. :returns: the document cursor :rtype: arango.cursor.Cursor :raises arango.exceptions.DocumentGetError: if the documents cannot be fetched from the collection """ res = self._conn.put(endpoint='/_api/simple/all', data={'collection': self._name}) if res.status_code not in HTTP_OK: raise DocumentGetError(res) return Cursor(self._conn, res.body)
def response_handler(resp): if not resp.is_success: raise AQLQueryExecuteError(resp, request) return Cursor(self._conn, resp.body)
def handler(res): if res.status_code not in HTTP_OK: raise AQLQueryExecuteError(res) return Cursor(self._conn, res.body)
def handler(res): if res.status_code not in HTTP_OK: raise DocumentGetError(res) return Cursor(self._conn, res.body)