Option C Tools
Loading...
Searching...
No Matches
test_with_claude.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3# tests/tests_scaffold/test_with_claude.py
4
5"""
6Purpose
7-------
8FS-541 regression coverage — ``oct scaffold --with-claude`` copies the
9bundled Claude Code skills into ``<project>/.claude/skills/``.
10
11Responsibilities
12----------------
13- Verify the template bundle directory exists and contains skills.
14- Verify ``_copy_claude_skills`` populates ``.claude/skills/`` with
15 expected ``SKILL.md`` files.
16- Verify skills are absent when ``--with-claude`` is not passed.
17
18Diagnostics
19-----------
20Domain: SCAFFOLD-TESTS
21 Levels:
22 L2 — test lifecycle
23 L3 — assertion details
24 L4 — deep tracing
25
26Contracts
27---------
28- All scaffold operations write to ``tmp_path``; no real project
29 directories are created.
30"""
31
32from __future__ import annotations
33
34from pathlib import Path
35
36from oct.scaffold import ScaffoldResult, run_scaffold
37from oct.scaffold.oct_scaffold import _copy_claude_skills, _CLAUDE_SKILLS_TEMPLATE_DIR
38
39
41 assert _CLAUDE_SKILLS_TEMPLATE_DIR.is_dir()
42 skills = list(_CLAUDE_SKILLS_TEMPLATE_DIR.iterdir())
43 assert len(skills) >= 8
44
45
47 result = run_scaffold("demo", tmp_path, include_venv=False)
48 project = tmp_path / "demo"
49 _copy_claude_skills(project, result)
50
51 skills_dir = project / ".claude" / "skills"
52 assert skills_dir.is_dir()
53 assert (skills_dir / "commit" / "SKILL.md").is_file()
54 assert (skills_dir / "lint" / "SKILL.md").is_file()
55
56
58 run_scaffold("demo", tmp_path, include_venv=False)
59 project = tmp_path / "demo"
60
61 assert not (project / ".claude").exists()
test_copy_claude_skills_absent_without_flag(Path tmp_path)
test_copy_claude_skills_populates_project(Path tmp_path)