(mocked_db_config, conn_handler)
| 250 | |
| 251 | @patch("tortoise.connection.ConnectionHandler.db_config", new_callable=PropertyMock) |
| 252 | def test_all(mocked_db_config, conn_handler): |
| 253 | mock_conn_1 = Mock(_check_loop=Mock(return_value=True)) |
| 254 | mock_conn_2 = Mock(_check_loop=Mock(return_value=True)) |
| 255 | conn_handler._storage = {"default": mock_conn_1, "other": mock_conn_2} |
| 256 | mocked_db_config.return_value = {"default": {}, "other": {}} |
| 257 | ret_val = conn_handler.all() |
| 258 | assert set(ret_val) == {mock_conn_1, mock_conn_2} |
| 259 | |
| 260 | |
| 261 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected
searching dependent graphs…