tests: add missing init files (#1831)
This commit is contained in:
parent
37de50144f
commit
6149b63a44
6 changed files with 5 additions and 21 deletions
|
|
@ -12,19 +12,13 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import textwrap
|
import textwrap
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
import anyio
|
import anyio
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from mcp import ClientSession, StdioServerParameters
|
from mcp import ClientSession, StdioServerParameters
|
||||||
from mcp.client.stdio import _create_platform_compatible_process, stdio_client
|
from mcp.client.stdio import _create_platform_compatible_process, stdio_client
|
||||||
|
from tests.shared.test_win32_utils import escape_path_for_python
|
||||||
# TODO(Marcelo): This doesn't seem to be the right path. We should fix this.
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from ..shared.test_win32_utils import escape_path_for_python
|
|
||||||
else:
|
|
||||||
from tests.shared.test_win32_utils import escape_path_for_python
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.anyio
|
@pytest.mark.anyio
|
||||||
|
|
|
||||||
0
tests/server/auth/__init__.py
Normal file
0
tests/server/auth/__init__.py
Normal file
0
tests/server/auth/middleware/__init__.py
Normal file
0
tests/server/auth/middleware/__init__.py
Normal file
|
|
@ -3,7 +3,7 @@ Tests for OAuth error handling in the auth handlers.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import unittest.mock
|
import unittest.mock
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import Any
|
||||||
from urllib.parse import parse_qs, urlparse
|
from urllib.parse import parse_qs, urlparse
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
@ -14,12 +14,7 @@ from starlette.applications import Starlette
|
||||||
|
|
||||||
from mcp.server.auth.provider import AuthorizeError, RegistrationError, TokenError
|
from mcp.server.auth.provider import AuthorizeError, RegistrationError, TokenError
|
||||||
from mcp.server.auth.routes import create_auth_routes
|
from mcp.server.auth.routes import create_auth_routes
|
||||||
|
from tests.server.fastmcp.auth.test_auth_integration import MockOAuthProvider
|
||||||
# TODO(Marcelo): This TYPE_CHECKING shouldn't be here, but pytest doesn't seem to get the module correctly.
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from ...server.fastmcp.auth.test_auth_integration import MockOAuthProvider
|
|
||||||
else:
|
|
||||||
from tests.server.fastmcp.auth.test_auth_integration import MockOAuthProvider
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import base64
|
import base64
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import Any
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
@ -14,9 +14,7 @@ from mcp.server.fastmcp.utilities.types import Audio, Image
|
||||||
from mcp.server.session import ServerSession
|
from mcp.server.session import ServerSession
|
||||||
from mcp.server.transport_security import TransportSecuritySettings
|
from mcp.server.transport_security import TransportSecuritySettings
|
||||||
from mcp.shared.exceptions import McpError
|
from mcp.shared.exceptions import McpError
|
||||||
from mcp.shared.memory import (
|
from mcp.shared.memory import create_connected_server_and_client_session as client_session
|
||||||
create_connected_server_and_client_session as client_session,
|
|
||||||
)
|
|
||||||
from mcp.types import (
|
from mcp.types import (
|
||||||
AudioContent,
|
AudioContent,
|
||||||
BlobResourceContents,
|
BlobResourceContents,
|
||||||
|
|
@ -27,9 +25,6 @@ from mcp.types import (
|
||||||
TextResourceContents,
|
TextResourceContents,
|
||||||
)
|
)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from mcp.server.fastmcp import Context
|
|
||||||
|
|
||||||
|
|
||||||
class TestServer:
|
class TestServer:
|
||||||
@pytest.mark.anyio
|
@pytest.mark.anyio
|
||||||
|
|
|
||||||
0
tests/shared/__init__.py
Normal file
0
tests/shared/__init__.py
Normal file
Loading…
Reference in a new issue