MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _test

Method _test

test/sql/test_insert_exec.py:527–551  ·  view source on GitHub ↗
(
        self,
        connection,
        stmt,
        row,
        returning=None,
        inserted_primary_key=False,
        table=None,
        parameters=None,
    )

Source from the content-addressed store, hash-verified

525 return t
526
527 def _test(
528 self,
529 connection,
530 stmt,
531 row,
532 returning=None,
533 inserted_primary_key=False,
534 table=None,
535 parameters=None,
536 ):
537 if parameters is not None:
538 r = connection.execute(stmt, parameters)
539 else:
540 r = connection.execute(stmt)
541
542 if returning:
543 returned = r.first()
544 eq_(returned, returning)
545 elif inserted_primary_key is not False:
546 eq_(r.inserted_primary_key, inserted_primary_key)
547
548 if table is None:
549 table = self.tables.foo
550
551 eq_(connection.execute(table.select()).first(), row)
552
553 def _test_multi(self, connection, stmt, rows, data):
554 connection.execute(stmt, rows)

Calls 4

eq_Function · 0.90
executeMethod · 0.45
firstMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected