MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_update_crit_sql

Method test_update_crit_sql

test/orm/test_composites.py:247–270  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

245 )
246
247 def test_update_crit_sql(self):
248 Edge, Point = (self.classes.Edge, self.classes.Point)
249
250 sess = self._fixture()
251
252 e1 = sess.execute(
253 select(Edge).filter(Edge.start == Point(14, 5))
254 ).scalar_one()
255
256 eq_(e1.end, Point(2, 7))
257
258 stmt = (
259 update(Edge)
260 .filter(Edge.start == Point(14, 5))
261 .values({Edge.end: Point(16, 10)})
262 )
263
264 self.assert_compile(
265 stmt,
266 "UPDATE edges SET x2=:x2, y2=:y2 WHERE edges.x1 = :x1_1 "
267 "AND edges.y1 = :y1_1",
268 params={"x2": 16, "x1_1": 14, "y2": 10, "y1_1": 5},
269 dialect="default",
270 )
271
272 def test_update_crit_evaluate(self):
273 Edge, Point = (self.classes.Edge, self.classes.Point)

Callers

nothing calls this directly

Calls 10

_fixtureMethod · 0.95
selectFunction · 0.90
eq_Function · 0.90
updateFunction · 0.90
assert_compileMethod · 0.80
PointClass · 0.70
scalar_oneMethod · 0.45
executeMethod · 0.45
filterMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected