Skip to content

Expand SimEngine API and error-path tests (#44)#47

Merged
SorraTheOrc merged 2 commits into
mainfrom
copilot/expand-simengine-api-tests
Dec 3, 2025
Merged

Expand SimEngine API and error-path tests (#44)#47
SorraTheOrc merged 2 commits into
mainfrom
copilot/expand-simengine-api-tests

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 3, 2025

Adds comprehensive test coverage for all public SimEngine APIs and error handling paths.

Tests Added (26 new, 8→34 total)

Initialization & Views

  • initialize_state validation (missing args, state before init)
  • query_view for all types (summary, snapshot, district, post-mortem)
  • Invalid view handling (unknown names, missing/invalid district_id)

APIs

  • director_feed structure and population after ticks
  • All explanations helpers: query_timeline, explain_metric, explain_faction, explain_agent, explain_district, why
  • Progression helpers: progression_summary, calculate_success_chance (with/without agent/faction), agent_roster_summary

Error Paths

  • EngineNotInitializedError on premature state access
  • ValueError on tick limit exceeded
  • ValueError on unknown views

Progression State

  • Validates progression updates when ticks advance
class TestErrorPaths:
    def test_advance_ticks_before_initialization_raises(self) -> None:
        engine = SimEngine()
        with pytest.raises(EngineNotInitializedError):
            engine.advance_ticks(1)

    def test_query_view_unknown_raises_valueerror(self) -> None:
        engine = SimEngine()
        engine.initialize_state(world="default")
        with pytest.raises(ValueError, match="Unknown view"):
            engine.query_view("nonexistent")
Original prompt

"Issue 44 - Expand SimEngine API and error-path tests" to test agent

Created from Copilot CLI via the copilot delegate command.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Add 26 new tests (8 to 34 total) covering:
- Initialization validation
- Query view with all views and invalid names
- Director feed API
- Explanations API (timeline, metrics, factions, agents, districts, why)
- Progression API (summary, success chance, agent modifiers, roster)
- Error paths (uninitialized engine, tick limits, invalid views)

Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Copilot AI changed the title [WIP] Expand SimEngine API and error-path tests Expand SimEngine API and error-path tests (#44) Dec 3, 2025
Copilot AI requested a review from SorraTheOrc December 3, 2025 03:57
@SorraTheOrc SorraTheOrc merged commit eacd229 into main Dec 3, 2025
2 checks passed
@SorraTheOrc SorraTheOrc deleted the copilot/expand-simengine-api-tests branch December 3, 2025 04: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.

2 participants