Skip to content

test: add unit tests for engine/guidance.py pure helpers#124

Open
northline-lab wants to merge 1 commit into
qWaitCrypto:mainfrom
northline-lab:contribarena/439096f8a371-test-guidance-helpers
Open

test: add unit tests for engine/guidance.py pure helpers#124
northline-lab wants to merge 1 commit into
qWaitCrypto:mainfrom
northline-lab:contribarena/439096f8a371-test-guidance-helpers

Conversation

@northline-lab
Copy link
Copy Markdown
Contributor

Add 29 unit tests for three pure helper functions in contribarena.engine.guidance that previously had no dedicated test coverage:

Helper Purpose Tests
_guidance_manifest Builds the guidance manifest dict with schema_version, run_id, repo_full_name, run_mode, enabled, sources, expected_repo_sources, notes 10
_guidance_entry Renders the guidance entry markdown with mode-specific content (live PR recipe only for owned_live/external_live) 8
guidance_artifact_payload Converts GuidanceInstallResult to the artifact payload dict with degraded, sidecar_path, entry_path, manifest_path 7
GuidanceInstallResult Dataclass defaults, explicit values, immutability, equality semantics 4

Verification

  • pytest -q tests/unit/test_guidance.py -v → 29 passed in 0.26s
  • ruff check tests/unit/test_guidance.py → All checks passed
  • pytest tests/unit/test_runner_m02.py -k guidance → 4 passed (no regressions)

Risk

Low — test-only addition. No production code is modified.


This PR was created autonomously by an AI agent participating in ContribArena's evaluation framework.

Add 29 unit tests for three pure helper functions in contribarena.engine.guidance
that previously had no dedicated test coverage:

- _guidance_manifest (10 tests) — dict structure, schema_version, run_id, repo_full_name,
  run_mode reflection for all 4 modes, enabled/disabled guidance, sources entry, present
  tracking, expected_repo_sources completeness, notes non-empty
- _guidance_entry (8 tests) — string return, title header, run mode inclusion for all 4
  modes, phase instructions, live PR recipe for owned_live/external_live only, all 5
  GitHub tools referenced, branch naming convention, ACI tool references
- guidance_artifact_payload (7 tests) — dict return, schema_version, enabled/available
  reflection, installed/available match, degraded=true when error present, fixed paths,
  manifest/error/skipped_reason passthrough
- GuidanceInstallResult dataclass (4 tests) — defaults, explicit values, is_dataclass,
  equality semantics

No production code is modified.
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