MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_negate_operator_label

Method test_negate_operator_label

test/sql/test_operators.py:3131–3145  ·  test/sql/test_operators.py::NegationTest.test_negate_operator_label
(self)

Source from the content-addressed store, hash-verified

3129 is_((-self.table1.c.myid).type, self.table1.c.myid.type)
3130
3131 def test_negate_operator_label(self):
3132 orig_expr = or_(
3133 self.table1.c.myid == 1, self.table1.c.myid == 2
3134 ).label(class="st">"foo")
3135 expr = not_(orig_expr)
3136 isinstance(expr, Label)
3137 eq_(expr.name, class="st">"foo")
3138 is_not(expr, orig_expr)
3139 is_(expr._element.operator, operator.inv) class="cm"># e.g. and not false_
3140
3141 self.assert_compile(
3142 expr,
3143 class="st">"NOT (mytable.myid = :myid_1 OR mytable.myid = :myid_2)",
3144 dialect=default.DefaultDialect(supports_native_boolean=False),
3145 )
3146
3147 def test_negate_operator_self_group(self):
3148 orig_expr = or_(

Callers

nothing calls this directly

Calls 7

or_Function · 0.90
not_Function · 0.90
eq_Function · 0.90
is_notFunction · 0.90
is_Function · 0.90
assert_compileMethod · 0.80
labelMethod · 0.45

Tested by

no test coverage detected