Create test fixture directories and integration tests for Phase 7 profile validation exit gate: Invalid profiles (tests/fixtures/profiles/invalid/): - unknown-key.yaml: unrecognized extraction tuning key - bad-combinator.yaml: malformed match combinators (scalar not list) - secret-key.yaml: forbidden api_key (PROFILE_SECRETS_FORBIDDEN) - malformed.yaml: unclosed bracket (YAML syntax error) Valid profiles (tests/fixtures/profiles/valid/): - minimal.yaml: smallest valid profile (name, description, priority only) - invoice-minimal.yaml: simplified invoice with match and extraction Resolution fixtures (tests/fixtures/profiles/resolution/): - custom-invoice.yaml: priority 100 overrides built-in (priority 50) - README.md: documents resolution priority order Integration tests (tests/integration/advanced/profiles.rs): - test_invalid_profiles_rejected: validates all 4 invalid profiles fail - test_valid_profiles_accepted: validates all 2 valid profiles pass - test_profile_resolution_order: tests --profile-dir override behavior - test_invalid_fixture_error_types: validates specific error messages Acceptance criteria: ✓ pdftract profiles validate rejects all 4 invalid files ✓ pdftract profiles validate accepts all 2 valid files ✓ Profile resolution order test passes Closes bf-2ypn2
21 lines
498 B
YAML
21 lines
498 B
YAML
# Profile with forbidden secret keys (should fail validation with PROFILE_SECRETS_FORBIDDEN)
|
|
name: secret_key_test
|
|
description: This profile contains forbidden secret keys
|
|
priority: 10
|
|
|
|
match:
|
|
any:
|
|
- text_contains:
|
|
patterns: ["invoice"]
|
|
|
|
# Invalid: api_key is a forbidden key (should trigger PROFILE_SECRETS_FORBIDDEN)
|
|
extraction:
|
|
reading_order: line_dominant
|
|
api_key: "sk-1234567890abcdef"
|
|
|
|
fields:
|
|
test_field:
|
|
type: string
|
|
extraction:
|
|
patterns:
|
|
- "(.*)"
|