def test_should_create_SubTlvs_from_bytearray_when_parse_method_is_called(self): # GIVEN sub_tlvs = any_prefix_sub_tlvs() factory = network_data.PrefixSubTlvsFactory(config.create_default_network_data_prefix_sub_tlvs_factories()) data = convert_prefix_sub_tlvs_to_bytearray(sub_tlvs) # WHEN actual_sub_tlvs = factory.parse(io.BytesIO(data), common.MessageInfo()) # THEN self.assertTrue(isinstance(actual_sub_tlvs, list)) self.assertEqual(sub_tlvs, actual_sub_tlvs)
def test_should_create_SubTlvs_from_bytearray_when_parse_method_is_called(self): # GIVEN sub_tlvs = any_prefix_sub_tlvs() factory = network_data.PrefixSubTlvsFactory(config.create_default_network_data_prefix_sub_tlvs_factories()) data = convert_prefix_sub_tlvs_to_bytearray(sub_tlvs) # WHEN actual_sub_tlvs = factory.parse(io.BytesIO(data), common.MessageInfo()) # THEN self.assertTrue(isinstance(actual_sub_tlvs, list)) self.assertEqual(sub_tlvs, actual_sub_tlvs)