mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
[BugFix] obb.famafrench.breakpoints - Fix Bad Widget Param Options (#7168)
* fix bad widget options * fix mcp tests? * rename test file * might have needed that .gitkeep * ignore mcp_server tests in noxfile for 3.9
This commit is contained in:
@@ -26,8 +26,19 @@ def unit_test_platform(session):
|
||||
)
|
||||
session.install("pytest")
|
||||
session.install("pytest-cov")
|
||||
|
||||
# Determine if we should ignore mcp_server tests based on Python version
|
||||
ignore_args = []
|
||||
if session.python == "3.9":
|
||||
ignore_args = ["--ignore=" + str(PLATFORM_DIR / "extensions/mcp_server/tests")]
|
||||
|
||||
session.run(
|
||||
"pytest", *PLATFORM_TESTS, f"--cov={PLATFORM_DIR}", "-m", "not integration"
|
||||
"pytest",
|
||||
*PLATFORM_TESTS,
|
||||
*ignore_args,
|
||||
f"--cov={PLATFORM_DIR}",
|
||||
"-m",
|
||||
"not integration",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
"""Tests for the MCP server extension."""
|
||||
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
# Skip all tests if Python version < 3.10
|
||||
if sys.version_info < (3, 10):
|
||||
pytest.skip("MCP server requires Python 3.10+", allow_module_level=True)
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Unit tests for config utilities."""
|
||||
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from unittest.mock import mock_open, patch
|
||||
|
||||
@@ -15,6 +16,10 @@ from openbb_mcp_server.utils.config import (
|
||||
)
|
||||
from openbb_mcp_server.utils.settings import MCPSettings
|
||||
|
||||
# Skip all tests if Python version < 3.10
|
||||
if sys.version_info < (3, 10):
|
||||
pytest.skip("MCP server requires Python 3.10+", allow_module_level=True)
|
||||
|
||||
|
||||
def test_get_mcp_config_path():
|
||||
path = get_mcp_config_path()
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
"""Unit tests for main module."""
|
||||
|
||||
import sys
|
||||
from unittest.mock import ANY, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from fastapi import FastAPI
|
||||
from openbb_mcp_server.main import _extract_brief_description, create_mcp_server, main
|
||||
from openbb_mcp_server.utils.settings import MCPSettings
|
||||
|
||||
# Skip all tests if Python version < 3.10
|
||||
if sys.version_info < (3, 10):
|
||||
pytest.skip("MCP server requires Python 3.10+", allow_module_level=True)
|
||||
|
||||
|
||||
def test_extract_brief_description():
|
||||
full_desc = """Brief description.
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
"""Unit tests for route filtering utilities."""
|
||||
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
from fastmcp.server.openapi import MCPType
|
||||
from openbb_mcp_server.utils.route_filtering import create_route_maps_from_settings
|
||||
from openbb_mcp_server.utils.settings import MCPSettings
|
||||
|
||||
# Skip all tests if Python version < 3.10
|
||||
if sys.version_info < (3, 10):
|
||||
pytest.skip("MCP server requires Python 3.10+", allow_module_level=True)
|
||||
|
||||
|
||||
def test_create_route_maps_from_settings_no_allowed():
|
||||
settings = MCPSettings(allowed_tool_categories=None)
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
"""Test schema compression in fastmcp."""
|
||||
|
||||
import json
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
from openbb_core.api.rest_api import app as fastapi_app
|
||||
from openbb_mcp_server.main import MCPSettings, create_mcp_server
|
||||
|
||||
# Skip all tests if Python version < 3.10
|
||||
if sys.version_info < (3, 10):
|
||||
pytest.skip("MCP server requires Python 3.10+", allow_module_level=True)
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
@pytest.mark.asyncio
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
"""Unit tests for MCPSettings model."""
|
||||
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
from openbb_mcp_server.utils.settings import MCPSettings
|
||||
|
||||
# Skip all tests if Python version < 3.10
|
||||
if sys.version_info < (3, 10):
|
||||
pytest.skip("MCP server requires Python 3.10+", allow_module_level=True)
|
||||
|
||||
|
||||
def test_mcp_settings_defaults():
|
||||
settings = MCPSettings()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Unit tests for ToolRegistry."""
|
||||
|
||||
# pylint: disable=redefined-outer-name
|
||||
|
||||
import sys
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
@@ -9,6 +9,10 @@ from fastmcp.server.openapi import OpenAPITool
|
||||
from openbb_mcp_server.registry import ToolRegistry
|
||||
from openbb_mcp_server.tool_models import ToggleResult
|
||||
|
||||
# Skip all tests if Python version < 3.10
|
||||
if sys.version_info < (3, 10):
|
||||
pytest.skip("MCP server requires Python 3.10+", allow_module_level=True)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def tool_registry():
|
||||
@@ -12,21 +12,12 @@ from openbb_core.provider.abstract.fetcher import Fetcher
|
||||
from openbb_core.provider.abstract.query_params import QueryParams
|
||||
from pydantic import Field
|
||||
|
||||
from openbb_famafrench.utils.constants import (
|
||||
BREAKPOINT_CHOICES,
|
||||
BreakpointChoices,
|
||||
)
|
||||
from openbb_famafrench.utils.constants import BreakpointChoices
|
||||
|
||||
|
||||
class FamaFrenchBreakpointQueryParams(QueryParams):
|
||||
"""Fama-French Breakpoints Query."""
|
||||
|
||||
__json_schema_extra__ = {
|
||||
"breakpoint_type": {
|
||||
"choices": BREAKPOINT_CHOICES,
|
||||
}
|
||||
}
|
||||
|
||||
breakpoint_type: BreakpointChoices = Field(
|
||||
default="me",
|
||||
description="""Type of breakpoint to fetch.
|
||||
|
||||
Reference in New Issue
Block a user