本文整理汇总了Python中gns3.topology.Topology._main_window方法的典型用法代码示例。如果您正苦于以下问题:Python Topology._main_window方法的具体用法?Python Topology._main_window怎么用?Python Topology._main_window使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gns3.topology.Topology
的用法示例。
在下文中一共展示了Topology._main_window方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_createDrawing_text
# 需要导入模块: from gns3.topology import Topology [as 别名]
# 或者: from gns3.topology.Topology import _main_window [as 别名]
def test_createDrawing_text():
topology = Topology()
shape_data = {
"x": 42,
"y": 12,
"z": 0,
"rotation": 0,
"drawing_id": str(uuid.uuid4()),
"svg": "<svg height=\"105.0\" width=\"158.0\"><text/></svg>",
}
topology._main_window = MagicMock()
topology.createDrawing(shape_data)
topology._main_window.uiGraphicsView.createDrawingItem.assert_called_with("text", 42, 12, 0, rotation=0, svg=shape_data["svg"], drawing_id=shape_data["drawing_id"])
示例2: test_createDrawing_ellipse
# 需要导入模块: from gns3.topology import Topology [as 别名]
# 或者: from gns3.topology.Topology import _main_window [as 别名]
def test_createDrawing_ellipse():
topology = Topology()
shape_data = {
"x": 42,
"y": 12,
"z": 0,
"rotation": 0,
"drawing_id": str(uuid.uuid4()),
"svg": "<svg height=\"105.0\" width=\"158.0\"><ellipse cx=\"79\" cy=\"52\" rx=\"79\" ry=\"53\" style=\"stroke-width:2;stroke:#000000;fill:#ffffff;\" /></svg>",
}
topology._main_window = MagicMock()
topology.createDrawing(shape_data)
topology._main_window.uiGraphicsView.createDrawingItem.assert_called_with("ellipse", 42, 12, 0, rotation=0, svg=shape_data["svg"], drawing_id=shape_data["drawing_id"])
示例3: test_createDrawing_svg
# 需要导入模块: from gns3.topology import Topology [as 别名]
# 或者: from gns3.topology.Topology import _main_window [as 别名]
def test_createDrawing_svg():
"""
If SVG is more complex we consider it as an image
"""
topology = Topology()
shape_data = {
"x": 42,
"y": 12,
"z": 0,
"rotation": 0,
"drawing_id": str(uuid.uuid4()),
"svg": "<svg height=\"105.0\" width=\"158.0\"><rect><line/></rect></svg>",
}
topology._main_window = MagicMock()
topology.createDrawing(shape_data)
topology._main_window.uiGraphicsView.createDrawingItem.assert_called_with("image", 42, 12, 0, rotation=0, svg=shape_data["svg"], drawing_id=shape_data["drawing_id"])