Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/tests/backend/v4/config/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,24 @@ async def test_close_connection_with_exception(self):
# Connection should still be removed
self.assertNotIn(process_id, config.connections)

async def test_send_status_update_async_success(self):
"""Test sending a plain string status update successfully."""

config = ConnectionConfig()
user_id = "user-123"
process_id = "process-456"
message = "Test message"
connection = AsyncMock()

config.add_connection(process_id, connection, user_id)

await config.send_status_update_async(message, user_id)

connection.send_text.assert_called_once()
sent_data = json.loads(connection.send_text.call_args[0][0])
self.assertIn('type', sent_data)
self.assertEqual(sent_data['data'], message)

async def test_send_status_update_async_no_user_id(self):
"""Test sending status update with no user ID."""

Expand Down
Loading