test_dossier_config_state.py¶
tests/test_dossier_config_state.py
A config macro's shipped default was indexed, and `dossier` reported a misleading answer.
test_a_macro_dossier_reports_its_configured_state
None test_dossier_config_state.test_a_macro_dossier_reports_its_configured_state(Path config_db)
The dossier must report the macro's configured state.
tests/test_dossier_config_state.py:102
Checks
assert sites, f"the dossier carries no config state at all: {sites!r}"assert ("include/mbedtls/mbedtls_config.h", "off") in seen, (f"the SHIPPED config's off state is missing — the one the marks asked for: {seen}" )
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-INDEX-004 | measured | |
| REQ-DDB-QUERY-001 | measured | |
| REQ-DDB-QUERY-003 | measured | |
| REQ-DDB-QUERY-004 | measured | |
| REQ-DDB-QUERY-006 | measured | |
| REQ-DDB-QUERY-010 | measured | |
| REQ-DDB-QUERY-012 | measured | |
| REQ-DDB-QUERY-013 | measured |
Source · 20 lines
def test_a_macro_dossier_reports_its_configured_state(config_db: Path) -> None:
"""THE REGRESSION, NAMED. Nothing in the reply said `off`, said `mbedtls_config.h`, or said
"commented out" — the three things the failed marks asked for.
@brief Config state reaches the reply.
@return None.
@version 1
"""
reply = dossier(config_db, "MBEDTLS_PLATFORM_MEMORY")
## A macro subject rides in the `function` section of the envelope — one envelope, one
## populated section — and `wire.one` flattens it for the served payload.
sites = reply.function.config_defaults
assert sites, f"the dossier carries no config state at all: {sites!r}"
seen = {(s.file, s.state) for s in sites}
assert ("include/mbedtls/mbedtls_config.h", "off") in seen, (
f"the SHIPPED config's off state is missing — the one the marks asked for: {seen}"
)
Activity · 5 steps
test_the_shipped_config_is_not_buried_among_profiles
None test_dossier_config_state.test_the_shipped_config_is_not_buried_among_profiles(Path config_db)
The shipped config site must be distinguishable from a profile header.
tests/test_dossier_config_state.py:127
Checks
assert sites, "no config state to order"assert sites[0].file == "include/mbedtls/mbedtls_config.h", (f"a profile header outranks the shipped config: {[s.file for s in sites]}" )
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-INDEX-004 | measured | |
| REQ-DDB-QUERY-001 | measured | |
| REQ-DDB-QUERY-003 | measured | |
| REQ-DDB-QUERY-004 | measured | |
| REQ-DDB-QUERY-006 | measured | |
| REQ-DDB-QUERY-010 | measured | |
| REQ-DDB-QUERY-012 | measured | |
| REQ-DDB-QUERY-013 | measured |
Source · 16 lines
def test_the_shipped_config_is_not_buried_among_profiles(config_db: Path) -> None:
"""**LISTING IT IS NOT ENOUGH IF IT READS AS ONE OPTION AMONG MANY.** `MBEDTLS_ERROR_C` DID
include the shipped site in `macros[]` — third, unordered, with no state — and its mark failed
anyway. A reader has to be able to tell which site is the default build.
@brief The shipped site is identifiable.
@return None.
@version 1
"""
reply = dossier(config_db, "MBEDTLS_PLATFORM_MEMORY")
sites = list(reply.function.config_defaults)
assert sites, "no config state to order"
assert sites[0].file == "include/mbedtls/mbedtls_config.h", (
f"a profile header outranks the shipped config: {[s.file for s in sites]}"
)1 more lines, not shown