MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_select_limit_offset

Method test_select_limit_offset

test/sql/test_query.py:943–955  ·  view source on GitHub ↗

Test the interaction between limit and offset

(self, connection)

Source from the content-addressed store, hash-verified

941
942 @testing.requires.offset
943 def test_select_limit_offset(self, connection):
944 """Test the interaction between limit and offset"""
945
946 users, addresses = self.tables("users", "addresses")
947
948 r = connection.execute(
949 users.select().limit(3).offset(2).order_by(users.c.user_id)
950 ).fetchall()
951 self.assert_(r == [(3, "ed"), (4, "wendy"), (5, "laura")])
952 r = connection.execute(
953 users.select().offset(5).order_by(users.c.user_id)
954 ).fetchall()
955 self.assert_(r == [(6, "ralph"), (7, "fido")])
956
957 def test_select_distinct_limit(self, connection):
958 """Test the interaction between limit and distinct"""

Callers

nothing calls this directly

Calls 7

fetchallMethod · 0.45
executeMethod · 0.45
order_byMethod · 0.45
offsetMethod · 0.45
limitMethod · 0.45
selectMethod · 0.45
assert_Method · 0.45

Tested by

no test coverage detected