MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_as_comparison

Method test_as_comparison

test/sql/test_functions.py:1069–1084  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1067 )
1068
1069 def test_as_comparison(self):
1070 fn = func.substring("foo", "foobar").as_comparison(1, 2)
1071 is_(fn.type._type_affinity, Boolean)
1072
1073 self.assert_compile(
1074 fn.left, ":substring_1", checkparams={"substring_1": "foo"}
1075 )
1076 self.assert_compile(
1077 fn.right, ":substring_1", checkparams={"substring_1": "foobar"}
1078 )
1079
1080 self.assert_compile(
1081 fn,
1082 "substring(:substring_1, :substring_2)",
1083 checkparams={"substring_1": "foo", "substring_2": "foobar"},
1084 )
1085
1086 def test_as_comparison_annotate(self):
1087 fn = func.foobar("x", "y", "q", "p", "r").as_comparison(2, 5)

Callers

nothing calls this directly

Calls 3

is_Function · 0.90
as_comparisonMethod · 0.80
assert_compileMethod · 0.80

Tested by

no test coverage detected