style: apply ruff auto-fix
- Auto-formatted code with ruff format - Applied ruff linting fixes with --fix Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -46,6 +46,7 @@ except ImportError: # pragma: no cover
|
|||||||
class _DropboxBadInputError(Exception): # type: ignore[no-redef]
|
class _DropboxBadInputError(Exception): # type: ignore[no-redef]
|
||||||
"""Stub — only used when the dropbox package is missing."""
|
"""Stub — only used when the dropbox package is missing."""
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
router = APIRouter(prefix="/integrations", tags=["integrations"])
|
router = APIRouter(prefix="/integrations", tags=["integrations"])
|
||||||
|
|
||||||
@@ -593,7 +594,10 @@ def _test_dropbox_connection(config: dict[str, Any] | None, credentials: dict[st
|
|||||||
return {"success": True, "message": f"Dropbox connection successful{name_str}"}
|
return {"success": True, "message": f"Dropbox connection successful{name_str}"}
|
||||||
except _DropboxAuthError as exc:
|
except _DropboxAuthError as exc:
|
||||||
logger.warning("Dropbox auth error: %s", exc)
|
logger.warning("Dropbox auth error: %s", exc)
|
||||||
return {"success": False, "message": "Dropbox authentication failed — check app_key, app_secret, and refresh_token"}
|
return {
|
||||||
|
"success": False,
|
||||||
|
"message": "Dropbox authentication failed — check app_key, app_secret, and refresh_token",
|
||||||
|
}
|
||||||
except _DropboxBadInputError as exc:
|
except _DropboxBadInputError as exc:
|
||||||
logger.warning("Dropbox bad input error: %s", exc)
|
logger.warning("Dropbox bad input error: %s", exc)
|
||||||
return {"success": False, "message": "Dropbox connection failed — invalid credentials format"}
|
return {"success": False, "message": "Dropbox connection failed — invalid credentials format"}
|
||||||
|
|||||||
@@ -932,9 +932,7 @@ class TestConnectionTestEndpoint:
|
|||||||
with patch("app.api.integrations.dbx_lib") as mock_dbx:
|
with patch("app.api.integrations.dbx_lib") as mock_dbx:
|
||||||
mock_instance = MagicMock()
|
mock_instance = MagicMock()
|
||||||
mock_dbx.Dropbox.return_value = mock_instance
|
mock_dbx.Dropbox.return_value = mock_instance
|
||||||
mock_instance.users_get_current_account.side_effect = dbx_exc.AuthError(
|
mock_instance.users_get_current_account.side_effect = dbx_exc.AuthError("req_id", MagicMock())
|
||||||
"req_id", MagicMock()
|
|
||||||
)
|
|
||||||
payload = {
|
payload = {
|
||||||
"integration_type": "DROPBOX",
|
"integration_type": "DROPBOX",
|
||||||
"config": {},
|
"config": {},
|
||||||
|
|||||||
Reference in New Issue
Block a user