MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_literal_interpretation_two

Method test_literal_interpretation_two

test/sql/test_case_statement.py:141–158  ·  view source on GitHub ↗

note this is modified as of #7287 to accept strings, tuples and other literal values as input where they are interpreted as bound values just like any other expression. Previously, an exception would be raised that the literal was ambiguous.

(self)

Source from the content-addressed store, hash-verified

139 )
140
141 def test_literal_interpretation_two(self):
142 """note this is modified as of #7287 to accept strings, tuples
143 and other literal values as input
144 where they are interpreted as bound values just like any other
145 expression.
146
147 Previously, an exception would be raised that the literal was
148 ambiguous.
149
150
151 """
152 self.assert_compile(
153 case(
154 (("x", "y"), "z"),
155 ),
156 "CASE WHEN :param_1 THEN :param_2 END",
157 checkparams={"param_1": ("x", "y"), "param_2": "z"},
158 )
159
160 def test_literal_interpretation_two_point_five(self):
161 """note this is modified as of #7287 to accept strings, tuples

Callers

nothing calls this directly

Calls 2

caseFunction · 0.90
assert_compileMethod · 0.80

Tested by

no test coverage detected