Skip to content

Commit 3ed037f

Browse files
GeneAIclaude
authored andcommitted
style: Fix black formatting in test files
Fixes CI failure caused by unformatted test files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 8ae9fbf commit 3ed037f

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

tests/unit/test_summarize.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,12 @@ def test_init_without_api_key_raises(self):
8888

8989
def test_init_with_custom_model(self):
9090
"""Test initialization with custom model."""
91-
summarizer = Summarizer(
92-
api_key=TEST_API_KEY,
93-
model="claude-3-5-sonnet-20241022"
94-
)
91+
summarizer = Summarizer(api_key=TEST_API_KEY, model="claude-3-5-sonnet-20241022")
9592
assert summarizer.model == "claude-3-5-sonnet-20241022"
9693

9794
def test_init_with_custom_max_tokens(self):
9895
"""Test initialization with custom max_tokens."""
99-
summarizer = Summarizer(
100-
api_key=TEST_API_KEY,
101-
max_tokens=8192
102-
)
96+
summarizer = Summarizer(api_key=TEST_API_KEY, max_tokens=8192)
10397
assert summarizer.max_tokens == 8192
10498

10599
def test_init_with_invalid_model_raises(self):
@@ -312,7 +306,9 @@ def test_build_prompt_limits_files(self, summarizer, sample_scope):
312306
assert "file9.py" in prompt
313307
assert "and 5 more files" in prompt
314308

315-
def test_build_prompt_includes_yaml_instructions(self, summarizer, sample_context, sample_scope):
309+
def test_build_prompt_includes_yaml_instructions(
310+
self, summarizer, sample_context, sample_scope
311+
):
316312
"""Test that prompt includes YAML instructions."""
317313
prompt = summarizer._build_prompt(sample_context, sample_scope)
318314

@@ -406,7 +402,9 @@ def test_build_document_index_refs(self, summarizer, sample_context, sample_scop
406402
assert 123 in doc_index.refs.issues
407403
assert "abc123" in doc_index.refs.commits
408404

409-
def test_build_document_index_uses_context_files(self, summarizer, sample_context, sample_scope):
405+
def test_build_document_index_uses_context_files(
406+
self, summarizer, sample_context, sample_scope
407+
):
410408
"""Test that files_changed comes from context."""
411409
parsed = yaml.safe_load(SAMPLE_YAML_RESPONSE)
412410
doc_index = summarizer._build_document_index(parsed, sample_context, sample_scope)
@@ -532,7 +530,9 @@ def test_generate_markdown_summary(self, summarizer, sample_doc_index):
532530
assert "Add login feature" in markdown
533531
assert "Implements user authentication" in markdown
534532

535-
def test_generate_markdown_changes(self, summarizer, sample_doc_index, sample_context_with_diff):
533+
def test_generate_markdown_changes(
534+
self, summarizer, sample_doc_index, sample_context_with_diff
535+
):
536536
"""Test changes section with diff."""
537537
markdown = summarizer._generate_markdown(sample_doc_index, sample_context_with_diff)
538538

@@ -655,7 +655,9 @@ def test_summarize_returns_tuple(self, mock_anthropic_response, sample_context,
655655
assert isinstance(result[0], DocumentIndex)
656656
assert isinstance(result[1], str)
657657

658-
def test_summarize_calls_api_correctly(self, mock_anthropic_response, sample_context, sample_scope):
658+
def test_summarize_calls_api_correctly(
659+
self, mock_anthropic_response, sample_context, sample_scope
660+
):
659661
"""Test that API is called with correct parameters."""
660662
with patch("memdocs.summarize.anthropic.Anthropic") as mock_client_class:
661663
mock_client = MagicMock()
@@ -707,7 +709,9 @@ def test_summarize_handles_unexpected_content_block(self, sample_context, sample
707709
with pytest.raises(ValueError, match="Unexpected content block type"):
708710
summarizer.summarize(sample_context, sample_scope)
709711

710-
def test_summarize_checks_rate_limit(self, mock_anthropic_response, sample_context, sample_scope):
712+
def test_summarize_checks_rate_limit(
713+
self, mock_anthropic_response, sample_context, sample_scope
714+
):
711715
"""Test that rate limiter is checked before API call."""
712716
with patch("memdocs.summarize.anthropic.Anthropic") as mock_client_class:
713717
mock_client = MagicMock()
@@ -834,7 +838,7 @@ def test_special_characters_in_commit_message(self):
834838
diff=GitDiff(
835839
commit="abc123",
836840
author="Test <[email protected]>",
837-
message="Fix bug with `code` and <html> & \"quotes\"",
841+
message='Fix bug with `code` and <html> & "quotes"',
838842
timestamp=datetime.now(timezone.utc).isoformat(),
839843
added_files=[],
840844
modified_files=[],

tests/unit/test_update_config_cmd.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ def test_update_config_mcp_existing_files_no_force(self, tmp_path, monkeypatch):
5454
(vscode_dir / "tasks.json").write_text("{}")
5555

5656
runner = CliRunner()
57-
with patch(
58-
"memdocs.cli_modules.commands.update_config_cmd._setup_mcp_infrastructure"
59-
):
57+
with patch("memdocs.cli_modules.commands.update_config_cmd._setup_mcp_infrastructure"):
6058
# User says no to overwrite
6159
result = runner.invoke(update_config, ["--mcp"], input="n\n")
6260
assert "cancelled" in result.output.lower()
@@ -120,9 +118,7 @@ def test_update_config_mcp_both_files_exist(self, tmp_path, monkeypatch):
120118
(vscode_dir / "settings.json").write_text("{}")
121119

122120
runner = CliRunner()
123-
with patch(
124-
"memdocs.cli_modules.commands.update_config_cmd._setup_mcp_infrastructure"
125-
):
121+
with patch("memdocs.cli_modules.commands.update_config_cmd._setup_mcp_infrastructure"):
126122
result = runner.invoke(update_config, ["--mcp"], input="n\n")
127123
assert "tasks.json" in result.output
128124
assert "settings.json" in result.output

0 commit comments

Comments
 (0)