test_wiki_theme_tokens.py¶
tests/test_wiki_theme_tokens.py
Success and info palette tokens; no colour outside a token (#73 item 4, 2.1).
test_the_palette_takes_success_and_info
None test_wiki_theme_tokens.test_the_palette_takes_success_and_info(Path tmp_path)
Four new words, mapped to CSS tokens, accepted without a problem.
tests/test_wiki_theme_tokens.py:26
Checks
assert {PALETTE[w] for w in ("success", "success_bg", "info", "info_bg")} == {assert not problems, problems
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_the_palette_takes_success_and_info → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-WIKI-054 | inferred | test_the_palette_takes_success_and_info → load_wiki_config → _comments → all |
Source · 17 lines
def test_the_palette_takes_success_and_info(tmp_path: Path) -> None:
"""@brief Four new words, mapped to CSS tokens, accepted without a problem."""
from clew.wiki.config import PALETTE, load_wiki_config
assert {PALETTE[w] for w in ("success", "success_bg", "info", "info_bg")} == {
"ok",
"okbg",
"info",
"infobg",
}
(tmp_path / ".clew.yaml").write_text(
"wiki:\n theme:\n palette: {success: '#1a7f37', info: '#0969da'}\n"
)
config, problems = load_wiki_config(tmp_path)
assert not problems, problems