Change to have parse *always* set serialized_on_wire

This commit is contained in:
Danny Weinberg
2020-06-04 16:20:32 -07:00
parent 5c700618fd
commit 28a288924f
2 changed files with 5 additions and 7 deletions

View File

@@ -39,11 +39,9 @@ def test_has_field():
2, betterproto.TYPE_STRING, betterproto.TYPE_STRING
)
# Unset with empty collections
# Is always set from parse, even if all collections are empty
with_collections_empty = WithCollections().parse(bytes(WithCollections()))
assert betterproto.serialized_on_wire(with_collections_empty) == False
# Set with non-empty collections
assert betterproto.serialized_on_wire(with_collections_empty) == True
with_collections_list = WithCollections().parse(
bytes(WithCollections(test_list=["a", "b", "c"]))
)