MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_entity_descriptor

Method test_entity_descriptor

test/orm/test_mapper.py:261–282  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

259 assert fn(arg) == ret
260
261 def test_entity_descriptor(self):
262 users = self.tables.users
263
264 from sqlalchemy.orm.base import _entity_descriptor
265
266 class Foo:
267 x = "something"
268
269 @property
270 def y(self):
271 return "something else"
272
273 m = self.mapper(Foo, users)
274 a1 = aliased(Foo)
275
276 for arg, key, ret in [
277 (m, "x", Foo.x),
278 (Foo, "x", Foo.x),
279 (a1, "x", a1.x),
280 (users, "name", users.c.name),
281 ]:
282 assert _entity_descriptor(arg, key) is ret
283
284 def test_friendly_attribute_str_on_uncompiled_boom(self):
285 User, users = self.classes.User, self.tables.users

Callers

nothing calls this directly

Calls 3

aliasedFunction · 0.90
_entity_descriptorFunction · 0.90
mapperMethod · 0.45

Tested by

no test coverage detected