MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_slice_access

Method test_slice_access

test/orm/test_dynamic.py:193–202  ·  view source on GitHub ↗
(self, user_address_fixture)

Source from the content-addressed store, hash-verified

191 )
192
193 def test_slice_access(self, user_address_fixture):
194 User, Address = user_address_fixture()
195
196 sess = fixture_session()
197 u1 = sess.get(User, 8)
198
199 eq_(u1.addresses.limit(1).one(), Address(id=2))
200
201 eq_(u1.addresses[0], Address(id=2))
202 eq_(u1.addresses[0:2], [Address(id=2), Address(id=3)])
203
204 def test_negative_slice_access_raises(self, user_address_fixture):
205 User, Address = user_address_fixture()

Callers

nothing calls this directly

Calls 6

fixture_sessionFunction · 0.90
eq_Function · 0.90
AddressClass · 0.70
getMethod · 0.45
oneMethod · 0.45
limitMethod · 0.45

Tested by

no test coverage detected