#1038 policy tests should handle None/missing values gracefully
Closed: Fixed Opened by mikem.

This is a follow up to PR #1000

Policy tests might be called with a wide range of data. It would generally be better to avoid raising an exception unless the the data is clearly nonsensical.

Many of our tests are already "friendly" in this regard, but some are not. In particular:

  • BoolTest could default to false when the field is absent. Policies that care about the difference can use the has test to distinguish.
  • Similarly our other base tests that use fields (MatchTest and CompareTest) could return False if there is no field to match

Metadata Update from @mikem:
- Issue set to the milestone: 1.17

Assigning to 1.17 for now, though maybe this needs to be in 1.16.1 ?

PR #1042

Commit 47912f04 fixes this issue

Commit 8370a8e0 fixes this issue

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/1038

Please continue any further discussion there.

Metadata
Related Pull Requests