Skip to content

Fail by name when the spec adds a grant context or input type #22

Done

Description

@chrisjkuch

AGENTS.md asks that tests write an expected outcome for every enum member as a literal table, parametrize over it, and assert the table covers the whole enum, so a value codegen adds fails a named test until someone records how it behaves (#21). Two tests still miss new values:

  • TestVariantDiscrimination (tests/test_permission_grants.py) checks 3 of the 15 grant contexts. List the expected variant class for every PermissionGrantEntityType except any, parametrize over that table, and assert it covers the enum. Every type has a variant today, but a new context type from the spec without one would fail to parse real responses with no test noticing.
  • SPEC_ENUM_VALUES (integration_tests/test_application_form_input_type_contract.py) hardcodes the InputType values it round-trips through PDC. Assert it matches set(InputType), so a value the spec adds or drops fails by name.

#21 already does this for the grantee-key validator and the Keycloak sync statuses.

Activity

  1. changed the title [-]Parametrize tests over enums, unions, and tables instead of hand-listed cases[/-] [+]Fail by name when the spec adds a grant context or input type[/+] on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Size

    None yet

    Target date

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions