MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_labeled_column_expr_role

Method test_labeled_column_expr_role

test/sql/test_roles.py:128–149  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

126 )
127
128 def test_labeled_column_expr_role(self):
129 c = column("q")
130 is_true(expect(roles.LabeledColumnExprRole, c).compare(c))
131
132 is_true(
133 expect(roles.LabeledColumnExprRole, c.label("foo")).compare(
134 c.label("foo")
135 )
136 )
137
138 is_true(
139 expect(
140 roles.LabeledColumnExprRole,
141 select(column("q")).scalar_subquery(),
142 ).compare(select(column("q")).label(None))
143 )
144
145 is_true(
146 expect(roles.LabeledColumnExprRole, not_a_thing1).compare(
147 literal(not_a_thing1).label(None)
148 )
149 )
150
151 def test_untyped_scalar_subquery(self):
152 """test for :ticket:`6181`"""

Callers

nothing calls this directly

Calls 8

columnFunction · 0.90
is_trueFunction · 0.90
expectFunction · 0.90
selectFunction · 0.90
literalFunction · 0.90
compareMethod · 0.45
labelMethod · 0.45
scalar_subqueryMethod · 0.45

Tested by

no test coverage detected