Fix regression when changing the FC connection type#1009
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the update_protocol_combobox_entries method to optimize validation logic and improve code clarity. The method now validates the current protocol selection before updating the combobox instead of updating it twice (once with the current selection and once with None if invalid).
Key changes:
- Refactored validation logic to check protocol validity before updating the combobox
- Replaced
.format(**locals())with explicit named parameters for better code clarity and safety - Updated test assertions to reflect the single combobox update call instead of two
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
ardupilot_methodic_configurator/frontend_tkinter_component_editor.py |
Refactored update_protocol_combobox_entries to validate selection first and update combobox once; improved error message formatting |
tests/test_frontend_tkinter_component_editor.py |
Updated test assertions to expect single set_entries_tuple call instead of two; updated comments to reflect new behavior |
Comments suppressed due to low confidence (1)
tests/test_frontend_tkinter_component_editor.py:37
- Call to ComponentEditorWindow.init with too few arguments; should be no fewer than 2.
editor = ComponentEditorWindow() # pylint: disable=no-value-for-parameter
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
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.
No description provided.