MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_different_limits

Method test_different_limits

test/ext/test_baked.py:495–511  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

493 )
494
495 def test_different_limits(self):
496 User = self.classes.User
497
498 bq = self.bakery(
499 lambda s: s.query(User.id, User.name).order_by(User.id)
500 )
501
502 bq += lambda q: q.limit(bindparam("limit")).offset(bindparam("offset"))
503 session = fixture_session()
504
505 for i in range(4):
506 for limit, offset, exp in [
507 (2, 1, [(8, "ed"), (9, "fred")]),
508 (3, 0, [(7, "jack"), (8, "ed"), (9, "fred")]),
509 (1, 2, [(9, "fred")]),
510 ]:
511 eq_(bq(session).params(limit=limit, offset=offset).all(), exp)
512
513 def test_disable_on_session(self):
514 User = self.classes.User

Callers

nothing calls this directly

Calls 10

bindparamFunction · 0.90
fixture_sessionFunction · 0.90
eq_Function · 0.90
bakeryMethod · 0.80
order_byMethod · 0.45
queryMethod · 0.45
offsetMethod · 0.45
limitMethod · 0.45
allMethod · 0.45
paramsMethod · 0.45

Tested by

no test coverage detected