def test_construct_attributes_ipv4(self): attr = { 1: 2, 2: [(2, [701, 71])], 3: '219.158.1.204', 5: 100, 6: b'', 7: (71, '16.96.243.103'), 8: ['4837:701', '4837:2100'], 9: '219.158.1.204', 10: ['219.158.1.209', '0.0.0.30']} attr_hex = Update.construct_attributes(attr, asn4=True) self.assertEqual(attr, Update.parse_attributes(attr_hex, asn4=True))
def test_construct_attributes_ipv4(self): attr = { 1: 2, 2: [(2, [701, 71])], 3: '219.158.1.204', 5: 100, 6: b'', 7: (71, '16.96.243.103'), 8: ['4837:701', '4837:2100'], 9: '219.158.1.204', 10: ['219.158.1.209', '0.0.0.30'] } attr_hex = Update.construct_attributes(attr, asn4=True) self.assertEqual(attr, Update.parse_attributes(attr_hex, asn4=True))