fix(mcp): Move all imports to the top of modules
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Tests for configuration validation."""
|
||||
|
||||
import logging
|
||||
import os
|
||||
from unittest.mock import patch
|
||||
|
||||
@@ -48,7 +49,6 @@ class TestQdrantConfigValidation:
|
||||
|
||||
def test_api_key_warning_in_local_mode(self, caplog):
|
||||
"""Test that API key in local mode triggers warning."""
|
||||
import logging
|
||||
|
||||
caplog.set_level(logging.WARNING, logger="nextcloud_mcp_server.config")
|
||||
Settings(
|
||||
@@ -59,7 +59,6 @@ class TestQdrantConfigValidation:
|
||||
|
||||
def test_api_key_no_warning_in_network_mode(self, caplog):
|
||||
"""Test that API key in network mode doesn't trigger warning."""
|
||||
import logging
|
||||
|
||||
caplog.set_level(logging.WARNING, logger="nextcloud_mcp_server.config")
|
||||
Settings(
|
||||
@@ -206,7 +205,6 @@ class TestChunkConfigValidation:
|
||||
|
||||
def test_small_chunk_size_warning(self, caplog):
|
||||
"""Test that chunk size < 512 triggers warning."""
|
||||
import logging
|
||||
|
||||
caplog.set_level(logging.WARNING, logger="nextcloud_mcp_server.config")
|
||||
Settings(
|
||||
@@ -221,7 +219,6 @@ class TestChunkConfigValidation:
|
||||
|
||||
def test_reasonable_chunk_size_no_warning(self, caplog):
|
||||
"""Test that chunk size >= 512 doesn't trigger warning."""
|
||||
import logging
|
||||
|
||||
caplog.set_level(logging.WARNING, logger="nextcloud_mcp_server.config")
|
||||
Settings(
|
||||
|
||||
@@ -8,6 +8,7 @@ APIs use OAuth.
|
||||
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import httpx
|
||||
import pytest
|
||||
|
||||
from nextcloud_mcp_server.app import setup_oauth_config_for_multi_user_basic
|
||||
@@ -207,7 +208,6 @@ class TestSetupOAuthConfigForMultiUserBasic:
|
||||
self, hybrid_auth_settings, mocker
|
||||
):
|
||||
"""Test handling of OIDC discovery HTTP errors."""
|
||||
import httpx
|
||||
|
||||
# Create a mock response with a status error
|
||||
mock_response = MagicMock()
|
||||
|
||||
Reference in New Issue
Block a user