MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_table_all

Method test_table_all

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

Source from the content-addressed store, hash-verified

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