Commit graph

3 commits

Author SHA1 Message Date
4714c2730a Fix streaming protocol tests for Message.query mocking and gevent conflicts
- Fix Message.query.filter_by() chain mocking in test_bedrock_streaming_protocol
  and test_streaming_protocol_backwards_compatibility
- Add is_gevent_patched() helper to detect monkey patching
- Skip bedrock test at runtime when gevent has already patched (avoids RecursionError)
2025-12-07 10:53:51 -05:00
Claude
09ccba41f6
Fix streaming protocol test failures
Fixed 3 failing tests by correcting mock setup:

1. test_bedrock_streaming_protocol: Changed from mocking app.get_s3_client
   to mocking boto3.client directly, since chat_claude creates its own client

2. test_streaming_content_accumulation: Fixed Message mock patching and
   changed query mock to return mock_message instead of None

3. test_error_handling_in_streaming: Fixed Message mock patching, changed
   query mock to return mock_message, and updated assertion to check for
   chat_message event instead of message_chunk with is_complete flag

All streaming protocol tests now pass.
2025-11-10 20:19:32 +00:00
dada6b3f22 Add comprehensive integration tests for streaming protocol
- Created test_streaming_protocol_simple.py with 3 passing tests
- Created test_streaming_protocol.py with comprehensive test suite
- Tests verify new protocol format with separate username/model fields
- Tests confirm content separation from metadata for clean TTS processing
- Added debug logging for Game Over feedback prompt
- All tests validate the streaming refactoring works correctly
2025-08-11 14:13:36 -04:00