MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_registry_set

Method test_registry_set

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

Source from the content-addressed store, hash-verified

911 eq_(p3.path, (amapper, amapper.attrs.email_address))
912
913 def test_registry_set(self):
914 reg = {}
915 umapper = inspect(self.classes.User)
916 amapper = inspect(self.classes.Address)
917
918 p1 = PathRegistry.coerce((umapper, umapper.attrs.addresses))
919 p2 = PathRegistry.coerce((umapper, umapper.attrs.addresses, amapper))
920 p3 = PathRegistry.coerce((amapper, amapper.attrs.email_address))
921
922 p1.set(reg, "p1key", "p1value")
923 p2.set(reg, "p2key", "p2value")
924 p3.set(reg, "p3key", "p3value")
925 eq_(
926 reg,
927 {
928 ("p1key", p1.path): "p1value",
929 ("p2key", p2.path): "p2value",
930 ("p3key", p3.path): "p3value",
931 },
932 )
933
934 def test_registry_get(self):
935 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