Skip to content

Comments

Fix test mocks to use created_at instead of timestamp for Message objects#52

Open
Copilot wants to merge 2 commits intoadkfrom
copilot/sub-pr-35
Open

Fix test mocks to use created_at instead of timestamp for Message objects#52
Copilot wants to merge 2 commits intoadkfrom
copilot/sub-pr-35

Conversation

Copy link

Copilot AI commented Feb 5, 2026

Test mocks were setting .timestamp on Message objects, but the Message model (inheriting from MemoryEntry) uses .created_at. This mismatch caused tests to not properly validate production behavior.

Changes

  • tests/unit/mcp/test_mcp_handlers.py: Changed mock_message.timestamp to mock_message.created_at (2 instances)
  • tests/unit/integrations/test_google_adk.py: Changed mock_msg.timestamp to mock_msg.created_at (4 instances)

Production code in handlers.py and types.py was already correct - both use msg.created_at.isoformat() and msg.created_at respectively.

# Before: mock sets wrong attribute
mock_msg.timestamp = datetime.now()

# After: mock matches actual Message model
mock_msg.created_at = datetime.now()

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

@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-memory Ready Ready Preview, Comment Feb 5, 2026 2:38pm

Co-authored-by: johnymontana <1222454+johnymontana@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on ADK and Vertex AI integrations Fix test mocks to use created_at instead of timestamp for Message objects Feb 5, 2026
Copilot AI requested a review from johnymontana February 5, 2026 14:40
@johnymontana johnymontana marked this pull request as ready for review February 6, 2026 17:19
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