Skip to content

fix(data-layer): DL-25 followup - Add story validation test - #100

Closed
spuentesp wants to merge 2 commits into
masterfrom
fix/DL-25-followup-tests
Closed

fix(data-layer): DL-25 followup - Add story validation test#100
spuentesp wants to merge 2 commits into
masterfrom
fix/DL-25-followup-tests

Conversation

@spuentesp

Copy link
Copy Markdown
Owner

Summary

Follow-up fixes to DL-25 after initial merge:

  1. Fix combat creation Neo4j validation (d1c36cb)

    • Updated mongodb_create_combat to use neo4j_client.execute_read() instead of raw session access
    • Fixed test mocking to match the corrected API
  2. Add combat story validation test (8caf6e3)

    • Added test_create_combat_story_not_found to verify error handling when story doesn't exist
    • Ensures combat creation properly validates story existence in Neo4j

These commits were added to the feature branch after PR #99 was merged.

Testing

All tests passing ✅

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Copilot AI review requested due to automatic review settings January 5, 2026 01:20
@github-actions github-actions Bot added area/data-layer Data layer changes type/tests Tests touched labels Jan 5, 2026
@spuentesp spuentesp closed this Jan 5, 2026
@spuentesp
spuentesp deleted the fix/DL-25-followup-tests branch January 5, 2026 01:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR contains follow-up fixes to DL-25, addressing Neo4j API usage and adding missing test coverage for story validation during combat creation.

Key Changes:

  • Refactored Neo4j story validation to use the proper execute_read() API instead of raw session access
  • Added test coverage for the story validation error path in combat creation
  • Updated test mocks to align with the corrected implementation

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/data-layer/src/monitor_data/tools/mongodb_tools.py Updated mongodb_create_combat to use neo4j_client.execute_read() instead of raw session API, consistent with other Neo4j operations in the codebase
packages/data-layer/tests/test_tools/test_combat_tools.py Simplified test mocking for test_create_combat_success by removing unnecessary intermediate mock objects, and added test_create_combat_story_not_found to verify proper error handling when story doesn't exist

Summary: The changes are well-implemented and properly tested. The refactored Neo4j API usage follows established patterns elsewhere in the codebase (e.g., mongodb_create_story_outline), and the new test appropriately covers the story validation error path. No issues were identified during review.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@spuentesp
spuentesp restored the fix/DL-25-followup-tests branch July 25, 2026 00:13
@spuentesp
spuentesp deleted the fix/DL-25-followup-tests branch July 25, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/data-layer Data layer changes type/tests Tests touched

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants