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
Checks
assert any("depth" in p for p in problems), problemsassert [f.depth for f in config.flows] == [3, 3]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_a_flow_depth_of_zero_is_refused_not_defaulted → _load → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-WIKI-054 | inferred | test_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
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
Checks
assert any("wiki.docs" in p for p in problems), problems
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_a_non_list_value_is_a_problem_not_a_default → _load → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-WIKI-054 | inferred | test_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
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
Checks
assert config.docs == () and config.tooling == (), problems
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_an_explicit_empty_list_is_empty → _load → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-WIKI-054 | inferred | test_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
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
Checks
assert config.entry_point_depth == 0 and not problemsassert any("entry_point_depth" in p for p in problems), problems
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_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-054 | inferred | test_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
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
Checks
assert getattr(config, key) == ("README.md",), problemsassert not problems
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_one_string_is_a_one_item_list → _load → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-WIKI-054 | inferred | test_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
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
Checks
assert config.theme.palette == (("acc", "#123456"),) and not problemsassert any("accent_bg" in p for p in problems), problems
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_palette_tokens_are_words_and_the_abbreviations_point_at_them → _load → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-WIKI-054 | inferred | test_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
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
Checks
assert "acceptance/*" not in config.tooling
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_the_default_tooling_names_no_single_repository → _load → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-WIKI-054 | inferred | test_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.tooling1 more lines, not shown