style: Run black formatter on 16 files
Applied black formatting to files modified in linting fixes: Source files (8): - config_extractor.py - doc_scraper.py - how_to_guide_builder.py - llms_txt_downloader.py - llms_txt_parser.py - pattern_recognizer.py - test_example_extractor.py - unified_codebase_analyzer.py Test files (8): - test_architecture_scenarios.py - test_async_scraping.py - test_github_scraper.py - test_guide_enhancer.py - test_install_agent.py - test_issue_219_e2e.py - test_llms_txt_downloader.py - test_skip_llms_txt.py All formatting issues resolved. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -174,7 +174,9 @@ class TestInstallToAgent:
|
||||
self.skill_dir.mkdir()
|
||||
|
||||
# Create SKILL.md
|
||||
(self.skill_dir / "SKILL.md").write_text("# Test Skill\n\nThis is a test skill.")
|
||||
(self.skill_dir / "SKILL.md").write_text(
|
||||
"# Test Skill\n\nThis is a test skill."
|
||||
)
|
||||
|
||||
# Create references directory with files
|
||||
refs_dir = self.skill_dir / "references"
|
||||
@@ -195,8 +197,13 @@ class TestInstallToAgent:
|
||||
with tempfile.TemporaryDirectory() as agent_tmpdir:
|
||||
agent_path = Path(agent_tmpdir) / ".claude" / "skills"
|
||||
|
||||
with patch("skill_seekers.cli.install_agent.get_agent_path", return_value=agent_path):
|
||||
success, message = install_to_agent(self.skill_dir, "claude", force=True)
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
return_value=agent_path,
|
||||
):
|
||||
success, message = install_to_agent(
|
||||
self.skill_dir, "claude", force=True
|
||||
)
|
||||
|
||||
assert success is True
|
||||
target_path = agent_path / "test-skill"
|
||||
@@ -208,8 +215,13 @@ class TestInstallToAgent:
|
||||
with tempfile.TemporaryDirectory() as agent_tmpdir:
|
||||
agent_path = Path(agent_tmpdir) / ".claude" / "skills"
|
||||
|
||||
with patch("skill_seekers.cli.install_agent.get_agent_path", return_value=agent_path):
|
||||
success, message = install_to_agent(self.skill_dir, "claude", force=True)
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
return_value=agent_path,
|
||||
):
|
||||
success, message = install_to_agent(
|
||||
self.skill_dir, "claude", force=True
|
||||
)
|
||||
|
||||
assert success is True
|
||||
target_path = agent_path / "test-skill"
|
||||
@@ -230,8 +242,13 @@ class TestInstallToAgent:
|
||||
with tempfile.TemporaryDirectory() as agent_tmpdir:
|
||||
agent_path = Path(agent_tmpdir) / ".claude" / "skills"
|
||||
|
||||
with patch("skill_seekers.cli.install_agent.get_agent_path", return_value=agent_path):
|
||||
success, message = install_to_agent(self.skill_dir, "claude", force=True)
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
return_value=agent_path,
|
||||
):
|
||||
success, message = install_to_agent(
|
||||
self.skill_dir, "claude", force=True
|
||||
)
|
||||
|
||||
assert success is True
|
||||
target_path = agent_path / "test-skill"
|
||||
@@ -248,8 +265,13 @@ class TestInstallToAgent:
|
||||
target_path = agent_path / "test-skill"
|
||||
target_path.mkdir(parents=True)
|
||||
|
||||
with patch("skill_seekers.cli.install_agent.get_agent_path", return_value=agent_path):
|
||||
success, message = install_to_agent(self.skill_dir, "claude", force=False)
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
return_value=agent_path,
|
||||
):
|
||||
success, message = install_to_agent(
|
||||
self.skill_dir, "claude", force=False
|
||||
)
|
||||
|
||||
assert success is False
|
||||
assert "already installed" in message.lower()
|
||||
@@ -263,8 +285,13 @@ class TestInstallToAgent:
|
||||
target_path.mkdir(parents=True)
|
||||
(target_path / "old_file.txt").write_text("old content")
|
||||
|
||||
with patch("skill_seekers.cli.install_agent.get_agent_path", return_value=agent_path):
|
||||
success, message = install_to_agent(self.skill_dir, "claude", force=True)
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
return_value=agent_path,
|
||||
):
|
||||
success, message = install_to_agent(
|
||||
self.skill_dir, "claude", force=True
|
||||
)
|
||||
|
||||
assert success is True
|
||||
# Old file should be gone
|
||||
@@ -297,8 +324,13 @@ class TestInstallToAgent:
|
||||
with tempfile.TemporaryDirectory() as agent_tmpdir:
|
||||
agent_path = Path(agent_tmpdir) / ".claude" / "skills"
|
||||
|
||||
with patch("skill_seekers.cli.install_agent.get_agent_path", return_value=agent_path):
|
||||
success, message = install_to_agent(self.skill_dir, "claude", dry_run=True)
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
return_value=agent_path,
|
||||
):
|
||||
success, message = install_to_agent(
|
||||
self.skill_dir, "claude", dry_run=True
|
||||
)
|
||||
|
||||
assert success is True
|
||||
assert "DRY RUN" in message
|
||||
@@ -329,7 +361,8 @@ class TestInstallToAllAgents:
|
||||
return Path(agent_tmpdir) / f".{agent_name}" / "skills"
|
||||
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path", side_effect=mock_get_agent_path
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
side_effect=mock_get_agent_path,
|
||||
):
|
||||
results = install_to_all_agents(self.skill_dir, force=True)
|
||||
|
||||
@@ -360,7 +393,8 @@ class TestInstallToAllAgents:
|
||||
return Path(agent_tmpdir) / f".{agent_name}" / "skills"
|
||||
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path", side_effect=mock_get_agent_path
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
side_effect=mock_get_agent_path,
|
||||
):
|
||||
# Without force - should fail
|
||||
results_no_force = install_to_all_agents(self.skill_dir, force=False)
|
||||
@@ -415,7 +449,10 @@ class TestInstallAgentCLI:
|
||||
|
||||
def test_cli_requires_agent_flag(self):
|
||||
"""Test that CLI fails without --agent flag."""
|
||||
with pytest.raises(SystemExit) as exc_info, patch("sys.argv", ["install_agent.py", str(self.skill_dir)]):
|
||||
with (
|
||||
pytest.raises(SystemExit) as exc_info,
|
||||
patch("sys.argv", ["install_agent.py", str(self.skill_dir)]),
|
||||
):
|
||||
main()
|
||||
|
||||
# Missing required argument exits with code 2
|
||||
@@ -428,17 +465,29 @@ class TestInstallAgentCLI:
|
||||
def mock_get_agent_path(agent_name, _project_root=None):
|
||||
return Path(agent_tmpdir) / f".{agent_name}" / "skills"
|
||||
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path", side_effect=mock_get_agent_path
|
||||
), patch(
|
||||
"sys.argv",
|
||||
["install_agent.py", str(self.skill_dir), "--agent", "claude", "--dry-run"],
|
||||
with (
|
||||
patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
side_effect=mock_get_agent_path,
|
||||
),
|
||||
patch(
|
||||
"sys.argv",
|
||||
[
|
||||
"install_agent.py",
|
||||
str(self.skill_dir),
|
||||
"--agent",
|
||||
"claude",
|
||||
"--dry-run",
|
||||
],
|
||||
),
|
||||
):
|
||||
exit_code = main()
|
||||
|
||||
assert exit_code == 0
|
||||
# Directory should NOT be created
|
||||
assert not (Path(agent_tmpdir) / ".claude" / "skills" / "test-skill").exists()
|
||||
assert not (
|
||||
Path(agent_tmpdir) / ".claude" / "skills" / "test-skill"
|
||||
).exists()
|
||||
|
||||
def test_cli_integration(self):
|
||||
"""Test end-to-end CLI execution."""
|
||||
@@ -447,11 +496,21 @@ class TestInstallAgentCLI:
|
||||
def mock_get_agent_path(agent_name, _project_root=None):
|
||||
return Path(agent_tmpdir) / f".{agent_name}" / "skills"
|
||||
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path", side_effect=mock_get_agent_path
|
||||
), patch(
|
||||
"sys.argv",
|
||||
["install_agent.py", str(self.skill_dir), "--agent", "claude", "--force"],
|
||||
with (
|
||||
patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
side_effect=mock_get_agent_path,
|
||||
),
|
||||
patch(
|
||||
"sys.argv",
|
||||
[
|
||||
"install_agent.py",
|
||||
str(self.skill_dir),
|
||||
"--agent",
|
||||
"claude",
|
||||
"--force",
|
||||
],
|
||||
),
|
||||
):
|
||||
exit_code = main()
|
||||
|
||||
@@ -468,11 +527,21 @@ class TestInstallAgentCLI:
|
||||
def mock_get_agent_path(agent_name, _project_root=None):
|
||||
return Path(agent_tmpdir) / f".{agent_name}" / "skills"
|
||||
|
||||
with patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path", side_effect=mock_get_agent_path
|
||||
), patch(
|
||||
"sys.argv",
|
||||
["install_agent.py", str(self.skill_dir), "--agent", "all", "--force"],
|
||||
with (
|
||||
patch(
|
||||
"skill_seekers.cli.install_agent.get_agent_path",
|
||||
side_effect=mock_get_agent_path,
|
||||
),
|
||||
patch(
|
||||
"sys.argv",
|
||||
[
|
||||
"install_agent.py",
|
||||
str(self.skill_dir),
|
||||
"--agent",
|
||||
"all",
|
||||
"--force",
|
||||
],
|
||||
),
|
||||
):
|
||||
exit_code = main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user