Ejemplo n.º 1
0
 def setUp(self) -> None:
     super().setUp()
     self.port_type1 = add_equipment_port_type(
         self.client,
         name="port type 1",
         properties=[
             PropertyDefinition(
                 property_name="port property",
                 property_kind=PropertyKind.string,
                 default_value="port property value",
                 is_fixed=False,
             )
         ],
         link_properties=[
             PropertyDefinition(
                 property_name="link property",
                 property_kind=PropertyKind.string,
                 default_value="link property value",
                 is_fixed=False,
             )
         ],
     )
     add_location_type(
         client=self.client,
         name="City",
         properties=[
             ("Mayor", "string", None, True),
             ("Contact", "email", None, True),
         ],
     )
     add_equipment_type(
         client=self.client,
         name="Tp-Link T1600G",
         category="Router",
         properties=[("IP", "string", None, True)],
         ports_dict={"tp_link_port": "port type 1"},
         position_list=[],
     )
     self.location = add_location(
         client=self.client,
         location_hirerchy=[("City", "Lima")],
         properties_dict={"Mayor": "Bernard King", "Contact": "*****@*****.**"},
         lat=10,
         long=20,
     )
     self.equipment = add_equipment(
         client=self.client,
         name="TPLinkRouter",
         equipment_type="Tp-Link T1600G",
         location=self.location,
         properties_dict={"IP": "127.0.0.1"},
     )
     self.equipment_with_external_id = add_equipment(
         client=self.client,
         name="TPLinkRouterExt",
         equipment_type="Tp-Link T1600G",
         location=self.location,
         properties_dict={"IP": "127.0.0.1"},
         external_id="12345",
     )
Ejemplo n.º 2
0
 def setUp(self) -> None:
     self.port_type1 = add_equipment_port_type(
         self.client,
         name="port type 1",
         properties=[
             PropertyDefinition(
                 property_name="port property",
                 property_kind=PropertyKind.string,
                 default_value="port property value",
                 is_fixed=False,
             )
         ],
         link_properties=[
             PropertyDefinition(
                 property_name="link property",
                 property_kind=PropertyKind.string,
                 default_value="link property value",
                 is_fixed=False,
             )
         ],
     )
     self.service_types_created = []
     self.service_types_created.append(
         add_service_type(
             client=self.client,
             name="Internet Access",
             hasCustomer=True,
             properties=[
                 ("Service Package", "string", "Public 5G", True),
                 ("Address Family", "string", None, True),
             ],
         ))
     self.location_types_created = []
     self.location_types_created.append(
         add_location_type(
             client=self.client,
             name="Room",
             properties=[("Contact", "email", None, True)],
         ))
     self.equipment_types_created = []
     self.equipment_types_created.append(
         add_equipment_type(
             client=self.client,
             name="Tp-Link T1600G",
             category="Router",
             properties=[("IP", "string", None, True)],
             ports_dict={
                 "Port 1": "port type 1",
                 "Port 2": "port type 1"
             },
             position_list=[],
         ))
Ejemplo n.º 3
0
 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")
Ejemplo n.º 4
0
 def setUp(self) -> None:
     self.port_type1 = add_equipment_port_type(
         self.client,
         name="port type 1",
         properties=[
             PropertyDefinition(
                 property_name="port property",
                 property_kind=PropertyKind.string,
                 default_value="port property value",
                 is_fixed=False,
             )
         ],
         link_properties=[
             PropertyDefinition(
                 property_name="link port property",
                 property_kind=PropertyKind.string,
                 default_value="link port property value",
                 is_fixed=False,
             )
         ],
     )
Ejemplo n.º 5
0
 def setUp(self) -> None:
     self.port_type1 = add_equipment_port_type(
         self.client,
         name="port type 1",
         properties=[
             PropertyDefinition(
                 property_name="port property",
                 property_kind=PropertyKind.string,
                 default_value="port property value",
                 is_fixed=False,
             )
         ],
         link_properties=[
             PropertyDefinition(
                 property_name="link property",
                 property_kind=PropertyKind.string,
                 default_value="link property value",
                 is_fixed=False,
             )
         ],
     )
     self.location_types_created = []
     self.location_types_created.append(
         add_location_type(
             client=self.client,
             name="City",
             properties=[
                 ("Mayor", "string", None, True),
                 ("Contact", "email", None, True),
             ],
         )
     )
     self.location = add_location(
         client=self.client,
         location_hirerchy=[("City", "Lima")],
         properties_dict={"Mayor": "Bernard King", "Contact": "*****@*****.**"},
         lat=10,
         long=20,
     )
     self.equipment_types_created = []
     self.equipment_types_created.append(
         add_equipment_type(
             client=self.client,
             name="Tp-Link T1600G",
             category="Router",
             properties=[("IP", "string", None, True)],
             ports_dict={"Port 1": "port type 1", "Port 2": "port type 1"},
             position_list=[],
         )
     )
     self.equipment1 = add_equipment(
         client=self.client,
         name="TPLinkRouter1",
         equipment_type="Tp-Link T1600G",
         location=self.location,
         properties_dict={"IP": "192.688.0.1"},
     )
     self.equipment2 = add_equipment(
         client=self.client,
         name="TPLinkRouter2",
         equipment_type="Tp-Link T1600G",
         location=self.location,
         properties_dict={"IP": "192.688.0.2"},
     )
     self.equipment3 = add_equipment(
         client=self.client,
         name="TPLinkRouter3",
         equipment_type="Tp-Link T1600G",
         location=self.location,
         properties_dict={"IP": "192.688.0.2"},
     )