devtools/testlib.py
changeset 10609 e2d8e81bfe68
parent 10603 65ad6980976e
child 10612 84468b90e9c1
equal deleted inserted replaced
10608:7fc548d9dd8e 10609:e2d8e81bfe68
    26 from math import log
    26 from math import log
    27 from contextlib import contextmanager
    27 from contextlib import contextmanager
    28 from warnings import warn
    28 from warnings import warn
    29 from itertools import chain
    29 from itertools import chain
    30 
    30 
       
    31 from six.moves import range
    31 from six.moves.urllib.parse import urlparse, parse_qs, unquote as urlunquote
    32 from six.moves.urllib.parse import urlparse, parse_qs, unquote as urlunquote
    32 
    33 
    33 import yams.schema
    34 import yams.schema
    34 
    35 
    35 from logilab.common.testlib import TestCase, InnerTest, Tags
    36 from logilab.common.testlib import TestCase, InnerTest, Tags
  1180                 if limit:
  1181                 if limit:
  1181                     rql = 'Any X LIMIT %s WHERE X is %s' % (limit, etype)
  1182                     rql = 'Any X LIMIT %s WHERE X is %s' % (limit, etype)
  1182                 else:
  1183                 else:
  1183                     rql = 'Any X WHERE X is %s' % etype
  1184                     rql = 'Any X WHERE X is %s' % etype
  1184                 rset = req.execute(rql)
  1185                 rset = req.execute(rql)
  1185                 for row in xrange(len(rset)):
  1186                 for row in range(len(rset)):
  1186                     if limit and row > limit:
  1187                     if limit and row > limit:
  1187                         break
  1188                         break
  1188                     # XXX iirk
  1189                     # XXX iirk
  1189                     rset2 = rset.limit(limit=1, offset=row)
  1190                     rset2 = rset.limit(limit=1, offset=row)
  1190                     yield rset2
  1191                     yield rset2