Skip to content

Add high-value unit tests for core classification and error logic#102

Merged
sarroutbi merged 1 commit into
keylime-webtool:mainfrom
sarroutbi:add-high-value-unit-tests
May 22, 2026
Merged

Add high-value unit tests for core classification and error logic#102
sarroutbi merged 1 commit into
keylime-webtool:mainfrom
sarroutbi:add-high-value-unit-tests

Conversation

@sarroutbi
Copy link
Copy Markdown
Contributor

Add 32 tests covering previously untested pure functions:

  • keylime/models.rs: is_push_mode() (4 tests) and parse_state_str() (8 tests)
  • models/agent.rs: from_push_agent() edge cases (6 tests) and from_operational_state() string variants (8 tests)
  • models/policy.rs: PolicyKind::classify() with agent data (3 tests)
  • error.rs: KeylimeApi error mapping to 502 (1 test)
  • models/agent.rs: timeout_state_filter_matches_serialized_form (1 test)
  • models/agent.rs: timeout_state_serde_roundtrip (1 test)

Add 32 tests covering previously untested pure functions:

- keylime/models.rs: is_push_mode() (4 tests) and parse_state_str() (8 tests)
- models/agent.rs: from_push_agent() edge cases (6 tests) and
  from_operational_state() string variants (8 tests)
- models/policy.rs: PolicyKind::classify() with agent data (3 tests)
- error.rs: KeylimeApi error mapping to 502 (1 test)
- models/agent.rs: timeout_state_filter_matches_serialized_form (1 test)
- models/agent.rs: timeout_state_serde_roundtrip (1 test)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
@sarroutbi sarroutbi merged commit ab5622a into keylime-webtool:main May 22, 2026
12 checks passed
@sarroutbi sarroutbi deleted the add-high-value-unit-tests branch May 22, 2026 10:35
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.

1 participant