python-betterproto
python-betterproto copied to clipboard
tests: add an encoding roundtrip for Struct
Summary
Follows #551. This currently fails, as expected, since dump() is not correctly specialized for Struct.
This is a work in progress.
Checklist
- [x] If code changes were made then they have been tested.
- [ ] I have updated the documentation to reflect the changes.
- [x] This PR fixes an issue.
- [ ] This PR adds something new (e.g. new method or parameters).
- [x] This change has an associated test.
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is not a code change (e.g. documentation, README, ...)
Just to post a brief update: per https://github.com/danielgtaylor/python-betterproto/pull/551#issuecomment-1972061214 and below, I don't yet have a great idea for a patch here. The basic thing that needs to happen is that dump() and load() need to be specialized for Struct, but doing so is weird because Struct is not referentially transparent against the underlying map<string, ...> type it contains.