MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_table_create_before

Method test_table_create_before

test/engine/test_ddlevents.py:37–55  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35 self.table = Table("t", self.metadata, Column("id", Integer))
36
37 def test_table_create_before(self):
38 table, bind = self.table, self.bind
39 canary = mock.Mock()
40 event.listen(table, "before_create", canary.before_create)
41
42 table.create(bind)
43 table.drop(bind)
44 eq_(
45 canary.mock_calls,
46 [
47 mock.call.before_create(
48 table,
49 self.bind,
50 checkfirst=CheckFirst.NONE,
51 _ddl_runner=mock.ANY,
52 _is_metadata_operation=mock.ANY,
53 )
54 ],
55 )
56
57 def test_table_create_after(self):
58 table, bind = self.table, self.bind

Callers

nothing calls this directly

Calls 5

eq_Function · 0.90
before_createMethod · 0.80
listenMethod · 0.45
createMethod · 0.45
dropMethod · 0.45

Tested by

no test coverage detected