Add strict mode to pyright (#315)

* Add strict mode to pyright

* Apply UP rule

* fix readme

* More correct

* Leave wrong Context for now

* Add strict mode to pyright

* Apply UP rule

* fix readme

* fix

* ignore
This commit is contained in:
Marcelo Trylesinski
2025-03-20 09:13:08 +00:00
committed by GitHub
parent 5a54d82459
commit ae77772ea8
27 changed files with 194 additions and 133 deletions

View File

@@ -1,5 +1,6 @@
import json
import subprocess
from pathlib import Path
from unittest.mock import patch
import pytest
@@ -8,7 +9,7 @@ from mcp.cli.claude import update_claude_config
@pytest.fixture
def temp_config_dir(tmp_path):
def temp_config_dir(tmp_path: Path):
"""Create a temporary Claude config directory."""
config_dir = tmp_path / "Claude"
config_dir.mkdir()
@@ -16,23 +17,20 @@ def temp_config_dir(tmp_path):
@pytest.fixture
def mock_config_path(temp_config_dir):
def mock_config_path(temp_config_dir: Path):
"""Mock get_claude_config_path to return our temporary directory."""
with patch("mcp.cli.claude.get_claude_config_path", return_value=temp_config_dir):
yield temp_config_dir
def test_command_execution(mock_config_path):
def test_command_execution(mock_config_path: Path):
"""Test that the generated command can actually be executed."""
# Setup
server_name = "test_server"
file_spec = "test_server.py:app"
# Update config
success = update_claude_config(
file_spec=file_spec,
server_name=server_name,
)
success = update_claude_config(file_spec=file_spec, server_name=server_name)
assert success
# Read the generated config