MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_text_doesnt_explode

Method test_text_doesnt_explode

test/sql/test_case_statement.py:221–244  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

219 )
220
221 def test_text_doesnt_explode(self, connection):
222 info_table = self.tables.info_table
223
224 for s in [
225 select(
226 case(
227 (info_table.c.info == "pk_4_data", text("'yes'")),
228 else_=text("'no'"),
229 )
230 ).order_by(info_table.c.info),
231 select(
232 case(
233 (
234 info_table.c.info == "pk_4_data",
235 literal_column("'yes'"),
236 ),
237 else_=literal_column("'no'"),
238 )
239 ).order_by(info_table.c.info),
240 ]:
241 eq_(
242 connection.execute(s).all(),
243 [("no",), ("no",), ("no",), ("yes",), ("no",), ("no",)],
244 )
245
246 def test_text_doenst_explode_even_in_whenlist(self):
247 """test #7287"""

Callers

nothing calls this directly

Calls 8

selectFunction · 0.90
caseFunction · 0.90
textFunction · 0.90
literal_columnFunction · 0.90
eq_Function · 0.90
order_byMethod · 0.45
allMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected