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

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measuredtest_the_palette_takes_success_and_info → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-WIKI-054inferredtest_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

Activity · 5 steps
lines 28–28from clew.wiki.config import PALETTE, load_wiki_configlines 30–35assert {PALETTE[w] for w in ("success", "success_bg", "info", "info_bg")} == { "ok", "okbg", "info", "infobg", }lines 36–38(tmp_path / ".clew.yaml").write_text( "wiki:\n theme:\n palette: {success: '#1a7f37', info: '#0969da'}\n" )lines 39–39config, problems = load_wiki_config(tmp_path)lines 40–40assert not problems, problems