test: restore clean test_send_status_update_async_success coverage#849
Draft
Copilot wants to merge 2 commits intobugfix/codeQL-suggestionsfrom
Draft
test: restore clean test_send_status_update_async_success coverage#849Copilot wants to merge 2 commits intobugfix/codeQL-suggestionsfrom
Copilot wants to merge 2 commits intobugfix/codeQL-suggestionsfrom
Conversation
2 tasks
Co-authored-by: Ayaz-Microsoft <234034413+Ayaz-Microsoft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix implemented codeQL and copilot suggestions
test: restore clean test_send_status_update_async_success coverage
Mar 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Restores a stable unit test for the “plain string message” success path in ConnectionConfig.send_status_update_async, ensuring the else: message_data = str(message) branch is exercised when a user has an active WebSocket connection.
Changes:
- Reintroduces
test_send_status_update_async_successto validate sending a plain-string status update. - Asserts a single
send_textcall and verifies the serialized payload’sdatamatches the input message.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #847 removed
test_send_status_update_async_successto eliminate a fragileif 'MagicMock' not in type_valconditional assertion, but this left the plain-string message success path ofsend_status_update_async(theelse: message_data = str(message)branch with a live connection) without any passing test.Changes
test_settings.py: Restorestest_send_status_update_async_successas a clean, assertion-stable test — verifiessend_textis called once and thedatafield matches the input string, without conditional mock-type guards:Note: The
isinstance(sys.modules['v4'], (Mock, MagicMock))change intest_app.pyandtest_plan_to_mplan_converter.pyis technically redundant (MagicMockis a subclass ofMock), but is harmless and left as-is.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.