def test200_IPVPNCreatePackUnpack(self):
        nlri = IPVPN.new(AFI(AFI.ipv4), SAFI(SAFI.mpls_vpn),
                         IP.pton("1.2.3.0"), 24,
                         Labels([42], True), 
                         RouteDistinguisher.fromElements("42.42.42.42", 5))

        packed = nlri.pack()
        unpacked,leftover = IPVPN.unpack_nlri(AFI(AFI.ipv4), SAFI(SAFI.mpls_vpn),
                                              packed, OUT.UNSET, None)

        self.assertEqual(0, len(leftover))

        # TODO: compare packed with a reference encoding verified 
        # as conformant with RFC4364

        self.assertTrue(isinstance(unpacked, IPVPN))

        self.assertEqual("1.2.3.0/24", unpacked.cidr.prefix())
        self.assertEqual(1, len(unpacked.labels.labels))
        self.assertEqual(42, unpacked.labels.labels[0])
        self.assertEqual("42.42.42.42:5", unpacked.rd._str())

    # Tests on EVPN NLRIs
Replace hypertext links by simple URL text.
dataset/ETHPy150Open Exa-Networks/exabgp/qa/tests/nlri_tests.py/TestNLRIs.test200_IPVPNCreatePackUnpack--crossover with--dataset/ETHPy150Open rossant/ipymd/ipymd/utils/utils.py/_flatten_links