mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-09-20 12:13:38 +08:00
feat: refresh course through workflow and goal loops
This commit is contained in:
33
tests/test_chapter_readmes.py
Normal file
33
tests/test_chapter_readmes.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import py_compile
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
CHAPTERS = sorted(ROOT.glob("s[0-9][0-9]_*"))
|
||||
|
||||
|
||||
def test_every_chapter_uses_english_as_the_default_readme() -> None:
|
||||
assert len(CHAPTERS) == 22
|
||||
|
||||
for chapter in CHAPTERS:
|
||||
assert (chapter / "README.md").is_file()
|
||||
assert (chapter / "README.zh.md").is_file()
|
||||
assert (chapter / "README.ja.md").is_file()
|
||||
assert not (chapter / "README.en.md").exists()
|
||||
|
||||
|
||||
def test_every_chapter_has_the_same_language_navigation() -> None:
|
||||
expected = (
|
||||
"[English](README.md) · [中文](README.zh.md) · "
|
||||
"[日本語](README.ja.md)"
|
||||
)
|
||||
|
||||
for chapter in CHAPTERS:
|
||||
for filename in ("README.md", "README.zh.md", "README.ja.md"):
|
||||
lines = (chapter / filename).read_text().splitlines()
|
||||
assert lines[2] == expected
|
||||
|
||||
|
||||
def test_every_chapter_script_compiles_on_python_311() -> None:
|
||||
for chapter in CHAPTERS:
|
||||
_ = py_compile.compile(str(chapter / "code.py"), doraise=True)
|
||||
Reference in New Issue
Block a user