MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_comparator_behavior

Method test_comparator_behavior

test/orm/test_composites.py:1839–1855  ·  view source on GitHub ↗
(self, custom, operator, fwd_op, rev_op)

Source from the content-addressed store, hash-verified

1837 argnames="operator, fwd_op, rev_op",
1838 )
1839 def test_comparator_behavior(self, custom, operator, fwd_op, rev_op):
1840 self._fixture(custom)
1841 Edge, Point = self.classes("Edge", "Point")
1842
1843 self.assert_compile(
1844 select(Edge).filter(operator(Edge.start, Point(3, 4))),
1845 "SELECT edge.id, edge.x1, edge.y1, edge.x2, edge.y2 FROM edge "
1846 f"WHERE edge.x1 {fwd_op} :x1_1 AND edge.y1 {fwd_op} :y1_1",
1847 checkparams={"x1_1": 3, "y1_1": 4},
1848 )
1849
1850 self.assert_compile(
1851 select(Edge).filter(~operator(Edge.start, Point(3, 4))),
1852 "SELECT edge.id, edge.x1, edge.y1, edge.x2, edge.y2 FROM edge "
1853 f"WHERE NOT (edge.x1 {fwd_op} :x1_1 AND edge.y1 {fwd_op} :y1_1)",
1854 checkparams={"x1_1": 3, "y1_1": 4},
1855 )
1856
1857 @testing.combinations(True, False, argnames="custom")
1858 @testing.combinations(

Callers

nothing calls this directly

Calls 5

_fixtureMethod · 0.95
selectFunction · 0.90
assert_compileMethod · 0.80
PointClass · 0.70
filterMethod · 0.45

Tested by

no test coverage detected