コード例 #1
0
ファイル: test_link.py プロジェクト: erssebaggala/magma
    def test_edit_link_properties(self) -> None:
        add_link(
            client=self.client,
            equipment_a=self.equipment1,
            port_name_a="Port 1",
            equipment_b=self.equipment2,
            port_name_b="Port 1",
        )
        fetched_port = get_port(client=self.client,
                                equipment=self.equipment1,
                                port_name="Port 1")
        edit_link_properties(
            client=self.client,
            equipment=self.equipment1,
            port_name="Port 1",
            new_link_properties={"link property": "test_link_property"},
        )
        fetched_port = get_port(client=self.client,
                                equipment=self.equipment1,
                                port_name="Port 1")

        link = fetched_port.link
        link_properties = link.properties if link else []
        self.assertEqual(1, len(link_properties))
        link_property = link_properties[0]
        link_property_type = link_property.propertyType if link_property else None
        property_name = link_property_type.name if link_property_type else None
        value = link_property.stringValue if link_property else None

        self.assertEqual(property_name, "link property")
        self.assertEqual(value, "test_link_property")
コード例 #2
0
ファイル: test_equipment.py プロジェクト: KingKongOne/magma
    def test_equipment_edit_port_properties(self) -> None:
        edit_port_properties(
            client=self.client,
            equipment=self.equipment,
            port_name="tp_link_port",
            new_properties={"port property": "test_port_property"},
        )
        fetched_port = get_port(client=self.client,
                                equipment=self.equipment,
                                port_name="tp_link_port")
        port_properties = fetched_port.properties
        self.assertEqual(len(port_properties), 1)

        property_type = port_properties[0].propertyType
        self.assertEqual(property_type.name, "port property")
        self.assertEqual(port_properties[0].stringValue, "test_port_property")
コード例 #3
0
ファイル: test_equipment.py プロジェクト: KingKongOne/magma
 def test_equipment_get_port(self) -> None:
     fetched_port = get_port(client=self.client,
                             equipment=self.equipment,
                             port_name="tp_link_port")
     self.assertEqual(self.port_type1.name,
                      fetched_port.definition.port_type_name)