chore: sort imports
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
import logging
|
||||
from nextcloud_mcp_server.config import setup_logging
|
||||
from collections.abc import AsyncIterator
|
||||
from contextlib import asynccontextmanager
|
||||
from dataclasses import dataclass
|
||||
from mcp.server.fastmcp import FastMCP, Context
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
from collections.abc import AsyncIterator
|
||||
|
||||
from mcp.server.fastmcp import Context, FastMCP
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
from nextcloud_mcp_server.config import setup_logging
|
||||
from nextcloud_mcp_server.server import (
|
||||
configure_calendar_tools,
|
||||
configure_notes_tools,
|
||||
configure_tables_tools,
|
||||
configure_webdav_tools,
|
||||
configure_calendar_tools,
|
||||
)
|
||||
|
||||
setup_logging()
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
import os
|
||||
from httpx import (
|
||||
AsyncClient,
|
||||
Auth,
|
||||
BasicAuth,
|
||||
Request,
|
||||
Response,
|
||||
)
|
||||
import logging
|
||||
import os
|
||||
|
||||
from httpx import AsyncClient, Auth, BasicAuth, Request, Response
|
||||
|
||||
from .notes import NotesClient
|
||||
from .webdav import WebDAVClient
|
||||
from .tables import TablesClient
|
||||
from .calendar import CalendarClient
|
||||
from ..controllers.notes_search import NotesSearchController
|
||||
from .calendar import CalendarClient
|
||||
from .notes import NotesClient
|
||||
from .tables import TablesClient
|
||||
from .webdav import WebDAVClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
"""Base client for Nextcloud operations with shared authentication."""
|
||||
|
||||
from abc import ABC
|
||||
from httpx import AsyncClient
|
||||
import logging
|
||||
from abc import ABC
|
||||
|
||||
from httpx import AsyncClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
"""CalDAV client for NextCloud calendar operations."""
|
||||
|
||||
import xml.etree.ElementTree as ET
|
||||
import datetime as dt
|
||||
from typing import Dict, Any, List, Optional, Tuple
|
||||
import logging
|
||||
from httpx import HTTPStatusError
|
||||
from icalendar import Calendar, Event as ICalEvent, vRecur, Alarm
|
||||
import uuid
|
||||
import xml.etree.ElementTree as ET
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from httpx import HTTPStatusError
|
||||
from icalendar import Alarm, Calendar
|
||||
from icalendar import Event as ICalEvent
|
||||
from icalendar import vRecur
|
||||
|
||||
from .base import BaseNextcloudClient
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Client for Nextcloud Notes app operations."""
|
||||
|
||||
from typing import Dict, List, Any, Optional
|
||||
import logging
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from .base import BaseNextcloudClient
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Client for Nextcloud Tables app operations."""
|
||||
|
||||
from typing import Dict, List, Any, Optional
|
||||
import logging
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from .base import BaseNextcloudClient
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"""WebDAV client for Nextcloud file operations."""
|
||||
|
||||
import mimetypes
|
||||
from typing import Tuple, Dict, Any, Optional, List
|
||||
import logging
|
||||
from httpx import HTTPStatusError
|
||||
import mimetypes
|
||||
import xml.etree.ElementTree as ET
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from httpx import HTTPStatusError
|
||||
|
||||
from .base import BaseNextcloudClient
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Controller for notes search functionality."""
|
||||
|
||||
from typing import List, Dict, Any
|
||||
from typing import Any, Dict, List
|
||||
|
||||
|
||||
class NotesSearchController:
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import logging
|
||||
import datetime as dt
|
||||
import logging
|
||||
from typing import Optional
|
||||
from mcp.server.fastmcp import FastMCP, Context
|
||||
|
||||
from mcp.server.fastmcp import Context, FastMCP
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import logging
|
||||
from mcp.server.fastmcp import FastMCP, Context
|
||||
|
||||
from mcp.server.fastmcp import Context, FastMCP
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import logging
|
||||
from mcp.server.fastmcp import FastMCP, Context
|
||||
|
||||
from mcp.server.fastmcp import Context, FastMCP
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import logging
|
||||
from mcp.server.fastmcp import FastMCP, Context
|
||||
|
||||
from mcp.server.fastmcp import Context, FastMCP
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
+10
-6
@@ -1,18 +1,20 @@
|
||||
import pytest
|
||||
import os
|
||||
import logging
|
||||
import os
|
||||
import uuid
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
from typing import Any, AsyncGenerator
|
||||
|
||||
import pytest
|
||||
from httpx import HTTPStatusError
|
||||
from mcp import ClientSession
|
||||
from mcp.client.sse import sse_client
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
async def nc_client() -> NextcloudClient:
|
||||
async def nc_client() -> AsyncGenerator[NextcloudClient, Any]:
|
||||
"""
|
||||
Fixture to create a NextcloudClient instance for integration tests.
|
||||
Uses environment variables for configuration.
|
||||
@@ -29,14 +31,16 @@ async def nc_client() -> NextcloudClient:
|
||||
logger.info(
|
||||
"NextcloudClient session fixture initialized and capabilities checked."
|
||||
)
|
||||
yield client
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to initialize NextcloudClient session fixture: {e}")
|
||||
pytest.fail(f"Failed to connect to Nextcloud or get capabilities: {e}")
|
||||
return client
|
||||
finally:
|
||||
await client.close()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def nc_mcp_client():
|
||||
async def nc_mcp_client() -> AsyncGenerator[ClientSession, Any]:
|
||||
"""
|
||||
Fixture to create an MCP client session for integration tests.
|
||||
"""
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import pytest
|
||||
import logging
|
||||
import time
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
from httpx import HTTPStatusError
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
"""Integration tests for Calendar CalDAV operations."""
|
||||
|
||||
import pytest
|
||||
import logging
|
||||
import uuid
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import pytest
|
||||
from httpx import HTTPStatusError
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import pytest
|
||||
import logging
|
||||
import time
|
||||
import uuid
|
||||
import logging
|
||||
from PIL import Image, ImageDraw
|
||||
from io import BytesIO
|
||||
|
||||
import pytest
|
||||
from httpx import HTTPStatusError # Import if needed for specific error checks
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import logging
|
||||
import pytest
|
||||
import uuid
|
||||
import json
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
from mcp import ClientSession
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
pytestmark = pytest.mark.integration
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import pytest
|
||||
import logging
|
||||
import asyncio
|
||||
import logging
|
||||
import uuid # Keep uuid if needed for generating unique data within tests
|
||||
|
||||
import pytest
|
||||
from httpx import HTTPStatusError
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import pytest
|
||||
import logging
|
||||
import asyncio
|
||||
import logging
|
||||
import uuid
|
||||
from typing import Any, Dict
|
||||
|
||||
import pytest
|
||||
from httpx import HTTPStatusError
|
||||
from typing import Dict, Any
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import pytest
|
||||
import logging
|
||||
import time
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
from httpx import HTTPStatusError
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
"""Integration tests for WebDAV operations."""
|
||||
|
||||
import pytest
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
from httpx import HTTPStatusError
|
||||
|
||||
from nextcloud_mcp_server.client import NextcloudClient
|
||||
|
||||
Reference in New Issue
Block a user