MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_metadata_create_both

Method test_metadata_create_both

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

Source from the content-addressed store, hash-verified

260 )
261
262 def test_metadata_create_both(self):
263 metadata, bind = self.metadata, self.bind
264 canary = mock.Mock()
265
266 event.listen(metadata, "before_create", canary.before_create)
267 event.listen(metadata, "after_create", canary.after_create)
268
269 metadata.create_all(bind)
270 metadata.drop_all(bind)
271 eq_(
272 canary.mock_calls,
273 [
274 mock.call.before_create(
275 metadata,
276 self.bind,
277 checkfirst=CheckFirst.NONE,
278 tables=list(metadata.tables.values()),
279 _ddl_runner=mock.ANY,
280 ),
281 mock.call.after_create(
282 metadata,
283 self.bind,
284 checkfirst=CheckFirst.NONE,
285 tables=list(metadata.tables.values()),
286 _ddl_runner=mock.ANY,
287 ),
288 ],
289 )
290
291 def test_metadata_drop_before(self):
292 metadata, bind = self.metadata, self.bind

Callers

nothing calls this directly

Calls 7

eq_Function · 0.90
create_allMethod · 0.80
drop_allMethod · 0.80
before_createMethod · 0.80
after_createMethod · 0.80
listenMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected