fix: a product the customer's scope spec names is not a leak; record the first scoping runs
Case 08 failed requirements_name_no_products for "Shared VPC", which the spec's stated topology names. Records cases 03 and 08 on the scoping branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -820,3 +820,29 @@ async def test_a_case_with_no_standards_has_no_such_check():
|
||||
result = await score_execution(CASE, execution(), HEADINGS, passing_terraform)
|
||||
|
||||
assert all(c.name != "code_follows_standards" for c in result.checks)
|
||||
|
||||
|
||||
async def test_a_product_the_customers_scope_spec_names_may_appear_in_requirements():
|
||||
"""Case 08: the spec said shared_vpc_hub_and_spoke, and "Shared VPC" in the
|
||||
requirements was scored as a product leaking in."""
|
||||
named = {
|
||||
"content": "## Functional requirements\nUse the Shared VPC topology stated.\n"
|
||||
"## Current state\nNone.",
|
||||
"attachments": {"requirements.json": SAMPLE_DATA["requirements.json"]},
|
||||
}
|
||||
with_spec = dataclasses.replace(
|
||||
CASE,
|
||||
required_products=("Shared VPC",),
|
||||
scope="networking:\n topology: shared_vpc_hub_and_spoke\n",
|
||||
)
|
||||
without = dataclasses.replace(CASE, required_products=("Shared VPC",))
|
||||
|
||||
stated = await score_execution(
|
||||
with_spec, execution(requirements=named), HEADINGS, passing_terraform
|
||||
)
|
||||
leaked = await score_execution(
|
||||
without, execution(requirements=named), HEADINGS, passing_terraform
|
||||
)
|
||||
|
||||
assert check(stated, "requirements_name_no_products").passed
|
||||
assert not check(leaked, "requirements_name_no_products").passed
|
||||
|
||||
Reference in New Issue
Block a user