

def test_parser(self):
    files = ['bgp4-open', 'bgp4-keepalive']
    dir = '../packet_data/bgp4/'
    for f in files:
        print(('testing %s' % f))
        binmsg = open((dir + f), 'rb').read()
        (msg, rest) = bgp.BGPMessage.parser(binmsg)
        binmsg2 = msg.serialize()
        eq_(binmsg, binmsg2)
        eq_(rest, b'')

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