MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_dml

Method test_dml

test/sql/test_from_linter.py:420–439  ·  view source on GitHub ↗
(self, dml, twotable, error)

Source from the content-addressed store, hash-verified

418 (False, False), (True, False), (True, True), argnames="twotable,error"
419 )
420 def test_dml(self, dml, twotable, error):
421 if dml.update:
422 stmt = update(self.a)
423 elif dml.delete:
424 stmt = delete(self.a)
425 else:
426 dml.fail()
427
428 stmt = stmt.where(self.a.c.col_a == "a1")
429 if twotable:
430 stmt = stmt.where(self.b.c.col_b == "a1")
431
432 if not error:
433 stmt = stmt.where(self.b.c.col_b == self.a.c.col_a)
434
435 froms, _ = find_unmatching_froms(stmt)
436 if error:
437 assert froms
438 else:
439 assert not froms
440
441
442class TestLinterRoundTrip(fixtures.TablesTest):

Callers

nothing calls this directly

Calls 5

updateFunction · 0.90
deleteFunction · 0.90
find_unmatching_fromsFunction · 0.85
failMethod · 0.45
whereMethod · 0.45

Tested by

no test coverage detected