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

Show on the map →

Called by none

Calls none

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

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measured
REQ-DDB-QUERY-001measured
REQ-DDB-QUERY-003measured
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-006measured
REQ-DDB-QUERY-010measured
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013measured
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
lines 110–110reply = dossier(config_db, "MBEDTLS_PLATFORM_MEMORY")lines 113–113sites = reply.function.config_defaultslines 115–115assert sites, f"the dossier carries no config state at all: {sites!r}"lines 116–116seen = {(s.file, s.state) for s in sites}lines 117–119assert ("include/mbedtls/mbedtls_config.h", "off") in seen, ( f"the SHIPPED config's off state is missing — the one the marks asked for: {seen}" )

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

Show on the map →

Called by none

Calls list

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

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measured
REQ-DDB-QUERY-001measured
REQ-DDB-QUERY-003measured
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-006measured
REQ-DDB-QUERY-010measured
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013measured
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

Activity · 4 steps
lines 136–136reply = dossier(config_db, "MBEDTLS_PLATFORM_MEMORY")lines 137–137sites = list(reply.function.config_defaults)lines 139–139assert sites, "no config state to order"lines 140–142assert sites[0].file == "include/mbedtls/mbedtls_config.h", ( f"a profile header outranks the shipped config: {[s.file for s in sites]}" )