def test_equipment_type_add_external_id_to_property_type(self) -> None: equipment_type_name = self.equipment_type.name property_type_name = "IP" property_type_id = get_property_type_id( client=self.client, entity_type=Entity.EquipmentType, entity_name=equipment_type_name, property_type_name=property_type_name, ) e_type = edit_equipment_type_property_type( client=self.client, equipment_type_name=equipment_type_name, property_type_id=property_type_id, new_property_definition=PropertyDefinition( property_name=property_type_name, property_kind=PropertyKind.string, default_value=None, is_fixed=False, external_id="12345", ), ) property_types = get_property_types( client=self.client, entity_type=Entity.EquipmentType, entity_name=e_type.name, ) fetched_property_type = None for property_type in property_types: if property_type.name == property_type_name: fetched_property_type = property_type self.assertIsNotNone(fetched_property_type) self.assertEqual(fetched_property_type.externalId, "12345")
def test_equipment_type_property_type_name(self) -> None: equipment_type_name = self.equipment_type.name property_type_name = "IP" new_name = "new_IP" property_type_id = get_property_type_id( client=self.client, entity_type=Entity.EquipmentType, entity_name=equipment_type_name, property_type_name=property_type_name, ) e_type = edit_equipment_type_property_type( client=self.client, equipment_type_name=equipment_type_name, property_type_id=property_type_id, new_property_definition=PropertyDefinition( property_name=new_name, property_kind=PropertyKind.string, default_raw_value=None, is_fixed=False, external_id=None, ), ) property_types = get_property_types( client=self.client, entity_type=Entity.EquipmentType, entity_name=e_type.name, ) fetched_property_type = None for property_type in property_types: property_type_input = format_to_property_type_input(property_type) if property_type_input.name == property_type_name: fetched_property_type = property_type_input self.assertEqual(fetched_property_type, None) for property_type in property_types: property_type_input = format_to_property_type_input(property_type) if property_type_input.name == new_name: fetched_property_type = property_type_input assert fetched_property_type is not None, f"property {new_name} does not exist" if fetched_property_type is not None: self.assertEqual(fetched_property_type.name, new_name)