MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_table_create_both

Method test_table_create_both

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

Source from the content-addressed store, hash-verified

75 )
76
77 def test_table_create_both(self):
78 table, bind = self.table, self.bind
79 canary = mock.Mock()
80 event.listen(table, "before_create", canary.before_create)
81 event.listen(table, "after_create", canary.after_create)
82
83 table.create(bind)
84 table.drop(bind)
85 eq_(
86 canary.mock_calls,
87 [
88 mock.call.before_create(
89 table,
90 self.bind,
91 checkfirst=CheckFirst.NONE,
92 _ddl_runner=mock.ANY,
93 _is_metadata_operation=mock.ANY,
94 ),
95 mock.call.after_create(
96 table,
97 self.bind,
98 checkfirst=CheckFirst.NONE,
99 _ddl_runner=mock.ANY,
100 _is_metadata_operation=mock.ANY,
101 ),
102 ],
103 )
104
105 def test_table_drop_before(self):
106 table, bind = self.table, self.bind

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected