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

Method test_adapt

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

Source from the content-addressed store, hash-verified

4068 )
4069
4070 def test_adapt(self):
4071 t = table("t", column("c"))
4072 s = select(t).with_for_update(read=True, of=t.c.c)
4073 a = t.alias()
4074 s2 = sql_util.ClauseAdapter(a).traverse(s)
4075 eq_(s2._for_update_arg.of, [a.c.c])
4076 self.assert_compile(
4077 s2,
4078 "SELECT t_1.c FROM t AS t_1 FOR SHARE OF t_1",
4079 dialect="postgresql",
4080 )
4081
4082
4083class 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