MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / test_serialization

Method test_serialization

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

Source from the content-addressed store, hash-verified

32
33class TestCAlert(unittest.TestCase):
34 def test_serialization(self):
35 alert = CAlert()
36 alert.setCancel = [1, 2, 3]
37 alert.strComment = b"Comment"
38 stream = BytesIO()
39
40 alert.stream_serialize(stream)
41 serialized = BytesIO(stream.getvalue())
42
43 deserialized = CAlert.stream_deserialize(serialized)
44 self.assertEqual(deserialized, alert)
45
46
47class TestCInv(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

stream_serializeMethod · 0.95
CAlertClass · 0.90
stream_deserializeMethod · 0.45

Tested by

no test coverage detected