fix: resolve linting issues and simplify tests

- Remove trailing whitespace from test files
- Consolidate strict_mcp_config test into test_default_options
- Keep only the essential transport test for CLI flag verification
This commit is contained in:
Lina Tawfik 2025-07-03 14:56:56 -07:00
parent 783c0f4d33
commit 6a6991f48c
No known key found for this signature in database
2 changed files with 3 additions and 11 deletions

View file

@ -143,13 +143,13 @@ class TestSubprocessCLITransport:
cmd = transport._build_command()
assert "--strict-mcp-config" in cmd
# Test that flag is not present when False
transport_no_strict = SubprocessCLITransport(
prompt="test",
options=ClaudeCodeOptions(strict_mcp_config=False),
cli_path="/usr/bin/claude",
)
cmd_no_strict = transport_no_strict._build_command()
assert "--strict-mcp-config" not in cmd_no_strict

View file

@ -69,6 +69,7 @@ class TestOptions:
assert options.permission_mode is None
assert options.continue_conversation is False
assert options.disallowed_tools == []
assert options.strict_mcp_config is False
def test_claude_code_options_with_tools(self):
"""Test Options with built-in tools."""
@ -105,12 +106,3 @@ class TestOptions:
)
assert options.model == "claude-3-5-sonnet-20241022"
assert options.permission_prompt_tool_name == "CustomTool"
def test_claude_code_options_with_strict_mcp_config(self):
"""Test Options with strict MCP config."""
options = ClaudeCodeOptions(strict_mcp_config=True)
assert options.strict_mcp_config is True
# Test default value
default_options = ClaudeCodeOptions()
assert default_options.strict_mcp_config is False