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

Method test_dynamic_map

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

Source from the content-addressed store, hash-verified

404 self.assertEqual(bb, bb2)
405
406 def test_dynamic_map(self):
407 b = BValue()
408 m = b.map26
409 s = BSimple()
410 s.int_1 = 123
411 m[Key(1, "")] = s
412
413 bb = ByteBuffer()
414 b.encode(bb)
415
416 # print(to_string(bb.buf, bb.ri, bb.size()))
417
418 b = BValue()
419 b.decode(bb)
420 m = b.map26
421 v = m[Key(1, "")]
422 self.assertIsNotNone(v)
423 self.assertEqual(BSimple, v.__class__)
424 self.assertEqual(123, v.int_1)
425
426
427if __name__ == '__main__':

Callers

nothing calls this directly

Calls 4

encodeMethod · 0.95
decodeMethod · 0.95
ByteBufferClass · 0.90
BValueClass · 0.50

Tested by

no test coverage detected