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

Method test_metadata_create_both

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

Source from the content-addressed store, hash-verified

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