Skip to content

tests: policy operator edge cases in test_policy_evaluator #5

Description

@CodewithJha

👋 New to open source?
Thanks for considering contributing to Mutiny.
This issue is intentionally beginner-friendly.
If you get stuck, ask questions in the comments.
We're happy to help.

Context

Policy evaluation is deterministic in Core. tests/unit/test_policy_evaluator.py already covers deny / require / forbid / numeric / context paths. Empty args and nested-path edges still have room without changing semantics.

Goal

Add focused unit cases for empty-args and/or nested path edge behavior, mirroring existing test class style.

Why it matters

Edge coverage protects contributors who extend operators later and documents expected behavior for the cheatsheet / examples.

Acceptance criteria

  • Add focused unit cases (empty tool args and/or nested context / arg paths)
  • uv run pytest tests/unit/test_policy_evaluator.py -q passes
  • No production behavior change unless a clear bug is found (call that out in the PR)
  • PR description links this issue

Suggested files

  • tests/unit/test_policy_evaluator.py
  • Read-only: operator / evaluator code under packages/mutiny_core/

Out of scope

  • New operators, changing constraint meaning, Hosted API tests

Hints

  • Mirror patterns in TestRequireArgsRefundLimit, TestContextConstraints, TestInvalidConstraints.
  • Prefer one small class or a few methods over a large rewrite.
  • If behavior is already correct, the PR is tests only — that’s success.

Difficulty

S · tests only

Docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerstestsUnit, integration, reliability tests

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions