feat: refresh course through workflow and goal loops

This commit is contained in:
Haoran
2026-07-30 19:14:04 +08:00
parent 2dd1852d9e
commit cb8fae1bdd
125 changed files with 10882 additions and 7661 deletions

View 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)