MCPcopy
hub / github.com/petertodd/python-bitcoinlib / test_serialization

Method test_serialization

bitcoin/tests/test_net.py:20–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18
19class TestUnsignedAlert(unittest.TestCase):
20 def test_serialization(self):
21 alert = CUnsignedAlert()
22 alert.setCancel = [1, 2, 3]
23 alert.strComment = b"Comment"
24 stream = BytesIO()
25
26 alert.stream_serialize(stream)
27 serialized = BytesIO(stream.getvalue())
28
29 deserialized = CUnsignedAlert.stream_deserialize(serialized)
30 self.assertEqual(deserialized, alert)
31
32
33class TestCAlert(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

stream_serializeMethod · 0.95
CUnsignedAlertClass · 0.90
stream_deserializeMethod · 0.45

Tested by

no test coverage detected