MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_update_crit_evaluate

Method test_update_crit_evaluate

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

Source from the content-addressed store, hash-verified

270 )
271
272 def test_update_crit_evaluate(self):
273 Edge, Point = (self.classes.Edge, self.classes.Point)
274
275 sess = self._fixture()
276
277 e1 = sess.execute(
278 select(Edge).filter(Edge.start == Point(14, 5))
279 ).scalar_one()
280
281 eq_(e1.end, Point(2, 7))
282
283 stmt = (
284 update(Edge)
285 .filter(Edge.start == Point(14, 5))
286 .values({Edge.end: Point(16, 10)})
287 )
288 sess.execute(stmt)
289
290 eq_(e1.end, Point(16, 10))
291
292 stmt = (
293 update(Edge)
294 .filter(Edge.start == Point(14, 5))
295 .values({Edge.end: Point(17, 8)})
296 )
297 sess.execute(stmt)
298
299 eq_(e1.end, Point(17, 8))
300
301 def test_update_crit_fetch(self):
302 Edge, Point = (self.classes.Edge, self.classes.Point)

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected