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

Method test_table_create_both

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

Source from the content-addressed store, hash-verified

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