* [fix] to_dict modifies the underlying message (#151) * add test for mapmessage * fix for to_dict * formatting * Apply suggestions from code review Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com> * change to_json to to_dict Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
19 lines
356 B
Python
19 lines
356 B
Python
from tests.output_betterproto.mapmessage import (
|
|
Nested,
|
|
Test,
|
|
)
|
|
|
|
|
|
def test_mapmessage_to_dict_preserves_message():
|
|
message = Test(
|
|
items={
|
|
"test": Nested(
|
|
count=1,
|
|
)
|
|
}
|
|
)
|
|
|
|
message.to_dict()
|
|
|
|
assert isinstance(message.items["test"], Nested), "Wrong nested type after to_dict"
|