MCPcopy
hub / github.com/danielgtaylor/python-betterproto / test_message_len_empty_string

Function test_message_len_empty_string

tests/test_streams.py:211–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

209
210
211def test_message_len_empty_string():
212 @dataclass
213 class Empty(betterproto.Message):
214 string: str = betterproto.string_field(1, "group")
215 integer: int = betterproto.int32_field(2, "group")
216
217 empty = Empty().from_dict({"string": ""})
218 assert len(empty) == len(bytes(empty))
219
220
221def test_calculate_varint_size_negative():

Callers

nothing calls this directly

Calls 2

EmptyClass · 0.70
from_dictMethod · 0.45

Tested by

no test coverage detected