MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_operate

Method test_operate

test/sql/test_operators.py:155–190  ·  test/sql/test_operators.py::DefaultColumnComparatorTest.test_operate
(self, operator, right)

Source from the content-addressed store, hash-verified

153 id_=class="st">"ns",
154 )
155 def test_operate(self, operator, right):
156 left = column(class="st">"left")
157
158 if operators.is_comparison(operator):
159 type_ = sqltypes.BOOLEANTYPE
160 else:
161 type_ = sqltypes.NULLTYPE
162
163 assert left.comparator.operate(operator, right).compare(
164 BinaryExpression(
165 coercions.expect(roles.WhereHavingRole, left),
166 coercions.expect(roles.WhereHavingRole, right),
167 operator,
168 type_=type_,
169 )
170 )
171
172 modifiers = operator(left, right).modifiers
173
174 assert operator(left, right).compare(
175 BinaryExpression(
176 coercions.expect(roles.WhereHavingRole, left),
177 coercions.expect(roles.WhereHavingRole, right),
178 operator,
179 modifiers=modifiers,
180 type_=type_,
181 )
182 )
183
184 self._loop_test(operator, right)
185
186 if operators.is_comparison(operator):
187 is_(
188 left.comparator.operate(operator, right).type,
189 sqltypes.BOOLEANTYPE,
190 )
191
192 def _loop_test(self, operator, *arg):
193 loop = LoopOperate()

Callers

nothing calls this directly

Calls 7

_loop_testMethod · 0.95
columnFunction · 0.90
is_Function · 0.90
BinaryExpressionClass · 0.85
is_comparisonMethod · 0.80
compareMethod · 0.45
operateMethod · 0.45

Tested by

no test coverage detected