Skip to content

test: cover set_privacy validation and record expansion - #14

Merged
FidelisMM merged 1 commit into
FidelisMM:mainfrom
GreedyC:codex/privacy-validation-tests
Oct 2, 2026
Merged

FidelisMM merged 1 commit into
FidelisMM:mainfrom
GreedyC:codex/privacy-validation-tests

Conversation

@GreedyC

@GreedyC GreedyC commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

What

Add offline unit tests for apple_console.set_privacy:

  • category/purpose case normalization and category × purpose × protection expansion;
  • default linked protection, unlinked tracking and linked tracking;
  • an empty privacy declaration;
  • exact category/purpose validation messages, including missing, empty and null purposes;
  • no _run_iris call when a later usage is invalid.

The tests patch _run_iris, inspect the serialized plan without executing JavaScript, and verify the returned result is forwarded. No production code changes.

Fixes #5.

Tested against

  • Real store (which one, test app)
  • Only offline (compile/import)

12 unittest tests pass. CI's ruff check src tests --select E9,F passes, as does warning-strict source compilation using Path.read_text() to close files. CONTRIBUTING's broader ruff check src reports existing findings in unchanged source files. Its literal compile command also emits unclosed-file ResourceWarnings; the context-safe equivalent passes.

Checklist

  • Publishing tools say "External action" in the docstring — no publishing tool changed
  • No credentials, real account ids or personal data
  • README "Hard-won lessons" updated if this fixes a store quirk — not applicable, tests only

AI assistance was used to write and verify these tests.

@FidelisMM FidelisMM left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @GreedyC, this is great! Exactly what #5 asked for: _run_iris is patched so nothing hits the network, the category × purpose × protection expansion is checked end to end, and the error messages are asserted verbatim, including the missing/empty/null purposes and the "nothing runs when a later usage is invalid" case. Ran it locally: 12/12 pass, ruff clean, CI green. Merging now.

@FidelisMM
FidelisMM merged commit 712a3c9 into FidelisMM:main Oct 2, 2026
1 check passed
@GreedyC

GreedyC commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review and for running the tests locally! Glad this covers #5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unit tests for apple_console.set_privacy validation

2 participants