MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / test_reset

Function test_reset

tests/test_connection.py:242–248  ·  view source on GitHub ↗
(conn_handler)

Source from the content-addressed store, hash-verified

240
241
242def test_reset(conn_handler):
243 conn_handler._storage = {"default": "modified_conn", "other": "other_conn"}
244 original_conn = Mock()
245 token = Mock(_handler=conn_handler, _alias="default", _old_value=original_conn, _used=False)
246 conn_handler.reset(token)
247 assert conn_handler._storage["default"] is original_conn
248 assert token._used is True
249
250
251@patch("tortoise.connection.ConnectionHandler.db_config", new_callable=PropertyMock)

Callers

nothing calls this directly

Calls 1

resetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…