test_wiki_config_values.py

tests/test_wiki_config_values.py

The `wiki:` section reads a value as written (R5-CFG F5/F15/F16/F25, W9, D2).

test_a_flow_depth_of_zero_is_refused_not_defaulted

None test_wiki_config_values.test_a_flow_depth_of_zero_is_refused_not_defaulted(Path tmp_path)

depth < 1 is a problem; an omitted depth is 3.

tests/test_wiki_config_values.py:56

Show on the map →

Called by none

Calls _load

Checks

  • assert any("depth" in p for p in problems), problems
  • assert [f.depth for f in config.flows] == [3, 3]

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measuredtest_a_flow_depth_of_zero_is_refused_not_defaulted → _load → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-WIKI-054inferredtest_a_flow_depth_of_zero_is_refused_not_defaulted → _load → load_wiki_config → _comments → all
Source · 13 lines
def test_a_flow_depth_of_zero_is_refused_not_defaulted(tmp_path: Path) -> None:
    """F16: depth 0 draws nothing, so it is a problem — never silently 3.

    @brief depth < 1 is a problem; an omitted depth is 3.
    """
    config, problems = _load(
        tmp_path, "  flows:\n    - {entry: main, depth: 0}\n    - {entry: run}\n"
    )
    assert any("depth" in p for p in problems), problems
    ## The flow is kept at the default depth WITH the problem reported — never silently 3.
    assert [f.depth for f in config.flows] == [3, 3]

Activity · 3 steps
lines 61–63config, problems = _load( tmp_path, " flows:\n - {entry: main, depth: 0}\n - {entry: run}\n" )lines 64–64assert any("depth" in p for p in problems), problemslines 66–66assert [f.depth for f in config.flows] == [3, 3]

test_a_non_list_value_is_a_problem_not_a_default

None test_wiki_config_values.test_a_non_list_value_is_a_problem_not_a_default(Path tmp_path)

`docs: {a: 1}` is reported.

tests/test_wiki_config_values.py:41

Show on the map →

Called by none

Calls _load

Checks

  • assert any("wiki.docs" in p for p in problems), problems

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measuredtest_a_non_list_value_is_a_problem_not_a_default → _load → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-WIKI-054inferredtest_a_non_list_value_is_a_problem_not_a_default → _load → load_wiki_config → _comments → all
Source · 6 lines
def test_a_non_list_value_is_a_problem_not_a_default(tmp_path: Path) -> None:
    """@brief `docs: {a: 1}` is reported."""
    _config, problems = _load(tmp_path, "  docs: {a: 1}\n")
    assert any("wiki.docs" in p for p in problems), problems

Activity · 2 steps
lines 43–43_config, problems = _load(tmp_path, " docs: {a: 1}\n")lines 44–44assert any("wiki.docs" in p for p in problems), problems

test_an_explicit_empty_list_is_empty

None test_wiki_config_values.test_an_explicit_empty_list_is_empty(Path tmp_path)

[] means none.

tests/test_wiki_config_values.py:47

Show on the map →

Called by none

Calls _load

Checks

  • assert config.docs == () and config.tooling == (), problems

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measuredtest_an_explicit_empty_list_is_empty → _load → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-WIKI-054inferredtest_an_explicit_empty_list_is_empty → _load → load_wiki_config → _comments → all
Source · 9 lines
def test_an_explicit_empty_list_is_empty(tmp_path: Path) -> None:
    """W9: `docs: []` states "no prose", not "the default prose".

    @brief [] means none.
    """
    config, problems = _load(tmp_path, "  docs: []\n  tooling: []\n")
    assert config.docs == () and config.tooling == (), problems

Activity · 2 steps
lines 52–52config, problems = _load(tmp_path, " docs: []\n tooling: []\n")lines 53–53assert config.docs == () and config.tooling == (), problems

test_entry_points_is_renamed_and_the_old_key_points_at_the_new_one

None test_wiki_config_values.test_entry_points_is_renamed_and_the_old_key_points_at_the_new_one(Path tmp_path)

The depth key is named for what it is.

tests/test_wiki_config_values.py:69

Show on the map →

Called by none

Calls _load

Checks

  • assert config.entry_point_depth == 0 and not problems
  • assert any("entry_point_depth" in p for p in problems), problems

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measuredtest_entry_points_is_renamed_and_the_old_key_points_at_the_new_one → _load → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-WIKI-054inferredtest_entry_points_is_renamed_and_the_old_key_points_at_the_new_one → _load → load_wiki_config → _comments → all
Source · 11 lines
def test_entry_points_is_renamed_and_the_old_key_points_at_the_new_one(tmp_path: Path) -> None:
    """F15: `entry_point_depth` says what it holds; `entry_points` is refused with a pointer.

    @brief The depth key is named for what it is.
    """
    config, problems = _load(tmp_path, "  entry_point_depth: 0\n")
    assert config.entry_point_depth == 0 and not problems
    _config, problems = _load(tmp_path, "  entry_points: 2\n")
    assert any("entry_point_depth" in p for p in problems), problems

Activity · 4 steps
lines 74–74config, problems = _load(tmp_path, " entry_point_depth: 0\n")lines 75–75assert config.entry_point_depth == 0 and not problemslines 76–76_config, problems = _load(tmp_path, " entry_points: 2\n")lines 77–77assert any("entry_point_depth" in p for p in problems), problems

test_one_string_is_a_one_item_list

None test_wiki_config_values.test_one_string_is_a_one_item_list(Path tmp_path, str key)

A bare string is one entry, never its characters.

tests/test_wiki_config_values.py:34

Show on the map →

Called by none

Calls _load

Checks

  • assert getattr(config, key) == ("README.md",), problems
  • assert not problems

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measuredtest_one_string_is_a_one_item_list → _load → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-WIKI-054inferredtest_one_string_is_a_one_item_list → _load → load_wiki_config → _comments → all
Source · 7 lines
def test_one_string_is_a_one_item_list(tmp_path: Path, key: str) -> None:
    """@brief A bare string is one entry, never its characters."""
    config, problems = _load(tmp_path, f"  {key}: README.md\n")
    assert getattr(config, key) == ("README.md",), problems
    assert not problems

Activity · 3 steps
lines 36–36config, problems = _load(tmp_path, f" {key}: README.md\n")lines 37–37assert getattr(config, key) == ("README.md",), problemslines 38–38assert not problems

test_palette_tokens_are_words_and_the_abbreviations_point_at_them

None test_wiki_config_values.test_palette_tokens_are_words_and_the_abbreviations_point_at_them(Path tmp_path)

Readable palette tokens.

tests/test_wiki_config_values.py:80

Show on the map →

Called by none

Calls _load

Checks

  • assert config.theme.palette == (("acc", "#123456"),) and not problems
  • assert any("accent_bg" in p for p in problems), problems

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measuredtest_palette_tokens_are_words_and_the_abbreviations_point_at_them → _load → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-WIKI-054inferredtest_palette_tokens_are_words_and_the_abbreviations_point_at_them → _load → load_wiki_config → _comments → all
Source · 12 lines
def test_palette_tokens_are_words_and_the_abbreviations_point_at_them(tmp_path: Path) -> None:
    """F25: a readable token maps onto the theme's CSS variable; an old abbreviation is refused
    naming its replacement.

    @brief Readable palette tokens.
    """
    config, problems = _load(tmp_path, "  theme:\n    palette: {accent: '#123456'}\n")
    assert config.theme.palette == (("acc", "#123456"),) and not problems
    _config, problems = _load(tmp_path, "  theme:\n    palette: {accbg: '#123456'}\n")
    assert any("accent_bg" in p for p in problems), problems

Activity · 4 steps
lines 86–86config, problems = _load(tmp_path, " theme:\n palette: {accent: '#123456'}\n")lines 87–87assert config.theme.palette == (("acc", "#123456"),) and not problemslines 88–88_config, problems = _load(tmp_path, " theme:\n palette: {accbg: '#123456'}\n")lines 89–89assert any("accent_bg" in p for p in problems), problems

test_the_default_tooling_names_no_single_repository

None test_wiki_config_values.test_the_default_tooling_names_no_single_repository(Path tmp_path)

Defaults are conventions, not this repo.

tests/test_wiki_config_values.py:92

Show on the map →

Called by none

Calls _load

Checks

  • assert "acceptance/*" not in config.tooling

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measuredtest_the_default_tooling_names_no_single_repository → _load → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-WIKI-054inferredtest_the_default_tooling_names_no_single_repository → _load → load_wiki_config → _comments → all
Source · 7 lines
def test_the_default_tooling_names_no_single_repository(tmp_path: Path) -> None:
    """D2: `acceptance/*` is this repository's layout, which it declares for itself.

    @brief Defaults are conventions, not this repo.
    """
    config, _problems = _load(tmp_path, "  title: x\n")
    assert "acceptance/*" not in config.tooling

1 more lines, not shown

Activity · 2 steps
lines 97–97config, _problems = _load(tmp_path, " title: x\n")lines 98–98assert "acceptance/*" not in config.tooling