Skip to content

Add unit tests for osism/tasks/conductor/utils#2210

Open
berendt wants to merge 1 commit intomainfrom
gh2202
Open

Add unit tests for osism/tasks/conductor/utils#2210
berendt wants to merge 1 commit intomainfrom
gh2202

Conversation

@berendt
Copy link
Copy Markdown
Member

@berendt berendt commented Apr 26, 2026

Covers the five small helpers in osism/tasks/conductor/utils.py with 100% line coverage: deep_compare (diff recording with empty-branch cleanup), deep_merge (recursion plus the "DELETE" sentinel), deep_decrypt (VaultLib mocked, exception-drop semantics for dicts vs. lists), is_secret_key (password/secret/ironic_osism matching) and load_yaml_file (missing/empty/malformed/OSError paths plus vault encrypted/decrypt-failure paths). Out-of-scope conductor helpers stay uncovered as the issue prescribes.

Closes #2202

AI-assisted: Claude Code

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • If osism.tasks.conductor.utils exposes a dedicated delete sentinel (e.g. a constant), consider importing and using that instead of the literal "DELETE" in the deep_merge tests to avoid tests silently diverging from the implementation if the sentinel value ever changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- If `osism.tasks.conductor.utils` exposes a dedicated delete sentinel (e.g. a constant), consider importing and using that instead of the literal "DELETE" in the deep_merge tests to avoid tests silently diverging from the implementation if the sentinel value ever changes.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Covers the five small helpers in osism/tasks/conductor/utils.py with
100% line coverage: deep_compare (diff recording with empty-branch
cleanup), deep_merge (recursion plus the "DELETE" sentinel), deep_decrypt
(VaultLib mocked, exception-drop semantics for dicts vs. lists),
_is_secret_key (password/secret/ironic_osism_ matching) and
load_yaml_file (missing/empty/malformed/OSError paths plus vault
encrypted/decrypt-failure paths). Out-of-scope conductor helpers stay
uncovered as the issue prescribes.

Closes #2202

AI-assisted: Claude Code
Signed-off-by: Christian Berendt <berendt@osism.tech>
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 osism/tasks/conductor/utils.py

1 participant