chore: Add tests that reproduce key parsing bugs#631
Merged
allenporter merged 2 commits intoPython-roborock:mainfrom Dec 5, 2025
Merged
chore: Add tests that reproduce key parsing bugs#631allenporter merged 2 commits intoPython-roborock:mainfrom
allenporter merged 2 commits intoPython-roborock:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive tests to verify fixes for key parsing bugs reported in issue #630. The tests ensure that dictionaries with integer keys are properly serialized and deserialized, both in generic data structures and in the caching library's specific objects.
- Added
nested_int_dictfield to test objects to validate integer key handling - Created parametrized test to verify both integer and string-integer key parsing
- Extended cache tests to include
CombinedMapInfowith integer keys for real-world validation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/test_containers.py | Adds nested_int_dict field to ComplexObject and creates parametrized test to verify integer key parsing works with both int and string representations |
| tests/devices/test_file_cache.py | Extends cache test data to include home_map_info with integer keys, testing real-world objects (CombinedMapInfo, NamedRoomMapping) |
| tests/devices/snapshots/test_file_cache.ambr | Updates test snapshots to reflect the new home_map_info data in cache test cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Lash-L
previously approved these changes
Dec 5, 2025
Collaborator
|
Oh gotta fix long before this one is merged |
Lash-L
approved these changes
Dec 5, 2025
Contributor
Author
referring to lint errors here? |
Collaborator
Yes sorry - mobile autocorrect |
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.
Add tests for #630. I first wrote the tests and made sure they failed without that PR, then confirm they pass with those changes.
The testing approach is:
(1) Have a test with a generic data type reproducing the issue
(2) Test the caching library with the specific objects causing the problem