MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_adapt

Method test_adapt

test/sql/test_selectable.py:4057–4067  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4055 )
4056
4057 def test_adapt(self):
4058 t = table("t", column("c"))
4059 s = select(t).with_for_update(read=True, of=t.c.c)
4060 a = t.alias()
4061 s2 = sql_util.ClauseAdapter(a).traverse(s)
4062 eq_(s2._for_update_arg.of, [a.c.c])
4063 self.assert_compile(
4064 s2,
4065 "SELECT t_1.c FROM t AS t_1 FOR SHARE OF t_1",
4066 dialect="postgresql",
4067 )
4068
4069
4070class AliasTest(fixtures.TestBase, AssertsCompiledSQL):

Callers

nothing calls this directly

Calls 8

tableFunction · 0.90
columnFunction · 0.90
selectFunction · 0.90
eq_Function · 0.90
assert_compileMethod · 0.80
with_for_updateMethod · 0.45
aliasMethod · 0.45
traverseMethod · 0.45

Tested by

no test coverage detected