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

Method test_registry_set

test/orm/test_utils.py:929–948  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

927 eq_(p3.path, (amapper, amapper.attrs.email_address))
928
929 def test_registry_set(self):
930 reg = {}
931 umapper = inspect(self.classes.User)
932 amapper = inspect(self.classes.Address)
933
934 p1 = PathRegistry.coerce((umapper, umapper.attrs.addresses))
935 p2 = PathRegistry.coerce((umapper, umapper.attrs.addresses, amapper))
936 p3 = PathRegistry.coerce((amapper, amapper.attrs.email_address))
937
938 p1.set(reg, "p1key", "p1value")
939 p2.set(reg, "p2key", "p2value")
940 p3.set(reg, "p3key", "p3value")
941 eq_(
942 reg,
943 {
944 ("p1key", p1.path): "p1value",
945 ("p2key", p2.path): "p2value",
946 ("p3key", p3.path): "p3value",
947 },
948 )
949
950 def test_registry_get(self):
951 reg = {}

Callers

nothing calls this directly

Calls 4

inspectFunction · 0.90
eq_Function · 0.90
coerceMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected