MCPcopy Create free account
hub / github.com/e2wugui/zeze / test_bean

Method test_bean

python/test/test_buffer.py:381–404  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

379 self.assertEqual(vle, ByteBuffer.to_long_n(b, 0, n))
380
381 def test_bean(self):
382 v = BValue()
383 v.string3 = "abc"
384 v.bytes8 = "xyz".encode('utf-8')
385 bean1 = Bean1(123)
386 bean1.V2[12] = 34
387 v.list9.append(bean1)
388 simple = BSimple()
389 simple.removed.int_1 = 999
390 v.map16[Key(11, "")] = simple
391
392 bb = ByteBuffer()
393 v.encode(bb)
394 v2 = BValue()
395 v2.decode(bb)
396 bb.ri = 0
397 bb2 = ByteBuffer()
398 v2.encode(bb2)
399
400 # print(v)
401 # print(v2)
402
403 self.assertEqual(bb.size(), bb2.size())
404 self.assertEqual(bb, bb2)
405
406 def test_dynamic_map(self):
407 b = BValue()

Callers

nothing calls this directly

Calls 8

encodeMethod · 0.95
decodeMethod · 0.95
sizeMethod · 0.95
ByteBufferClass · 0.90
encodeMethod · 0.65
BValueClass · 0.50
Bean1Class · 0.50
appendMethod · 0.45

Tested by

no test coverage detected