

def test_stream_parser(self):
    msgs = [bgp.BGPNotification(error_code=1, error_subcode=2, data=b'foo'), bgp.BGPNotification(error_code=3, error_subcode=4, data=b'bar'), bgp.BGPNotification(error_code=5, error_subcode=6, data=b'baz')]
    binmsgs = b''.join([bytes(msg.serialize()) for msg in msgs])
    sp = bgp.StreamParser()
    results = []
    for b in binmsgs:
        for m in sp.parse(b):
            results.append(m)
    eq_(str(results), str(msgs))

dataset/ETHPy150Open osrg/ryu/ryu/tests/unit/packet/test_bgp.py Test_bgp.test_stream_parser/original