MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_table_all

Method test_table_all

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

Source from the content-addressed store, hash-verified

172 )
173
174 def test_table_all(self):
175 table, bind = self.table, self.bind
176 canary = mock.Mock()
177
178 event.listen(table, "before_create", canary.before_create)
179 event.listen(table, "after_create", canary.after_create)
180 event.listen(table, "before_drop", canary.before_drop)
181 event.listen(table, "after_drop", canary.after_drop)
182
183 table.create(bind)
184 table.drop(bind)
185 eq_(
186 canary.mock_calls,
187 [
188 mock.call.before_create(
189 table,
190 self.bind,
191 checkfirst=False,
192 _ddl_runner=mock.ANY,
193 _is_metadata_operation=mock.ANY,
194 ),
195 mock.call.after_create(
196 table,
197 self.bind,
198 checkfirst=False,
199 _ddl_runner=mock.ANY,
200 _is_metadata_operation=mock.ANY,
201 ),
202 mock.call.before_drop(
203 table,
204 self.bind,
205 checkfirst=False,
206 _ddl_runner=mock.ANY,
207 _is_metadata_operation=mock.ANY,
208 ),
209 mock.call.after_drop(
210 table,
211 self.bind,
212 checkfirst=False,
213 _ddl_runner=mock.ANY,
214 _is_metadata_operation=mock.ANY,
215 ),
216 ],
217 )
218
219 def test_metadata_create_before(self):
220 metadata, bind = self.metadata, self.bind

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected