test_codeowners_patterns_follow_gitignore¶
Tests › tests/test_owners.py
What this test is for
Why it exists
An unanchored name matches at any depth; a leading `/` anchors; `*` stays in one segment.
Verifies REQ-DDB-INDEX-007
Given
- —
When
rules = parse_codeowners("docs/ @d\n/build/*.c @b\nlogs @l\n")codeowners_for(rules, "docs/x/y.md")codeowners_for(rules, "build/a.c")
2 more
codeowners_for(rules, "build/sub/a.c")codeowners_for(rules, "app/logs/out.txt")
Then
- ✓ codeowners_for(rules, "docs/x/y.md") equals (["@d"], 1)
- ✓ codeowners_for(rules, "build/a.c") equals (["@b"], 2)
- ✓ codeowners_for(rules, "build/sub/a.c") is None
- ✓ codeowners_for(rules, "app/logs/out.txt") equals (["@l"], 3)
tests/test_owners.py:29 · its file's page
What it checks (4)
assert codeowners_for(rules, "docs/x/y.md") == (["@d"], 1)observescodeowners_forassert codeowners_for(rules, "build/a.c") == (["@b"], 2)observescodeowners_forassert codeowners_for(rules, "build/sub/a.c") is Noneobservescodeowners_forassert codeowners_for(rules, "app/logs/out.txt") == (["@l"], 3)observescodeowners_for
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
test_codeowners_patterns_follow_gitignore→parse_codeowners→codeowners_forWhat it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-INDEX-007 | catalog | unknown |