コード例 #1
0
    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()
コード例 #2
0
    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)
コード例 #3
0
 def response_handler(resp):
     if not resp.is_success:
         raise AQLQueryExecuteError(resp, request)
     return Cursor(self._conn, resp.body)
コード例 #4
0
 def handler(res):
     if res.status_code not in HTTP_OK:
         raise AQLQueryExecuteError(res)
     return Cursor(self._conn, res.body)
コード例 #5
0
 def handler(res):
     if res.status_code not in HTTP_OK:
         raise DocumentGetError(res)
     return Cursor(self._conn, res.body)