3 from neco.design.box import Box
4 from neco.util.plot import Plotter
9 class BoxPlotTestCase(unittest.TestCase):
11 """ XXX: This test is interactive, it will open an evince instance,
12 so it should not run automatically """
13 node1 = Box(label="node1")
14 ping1 = Box(label="ping")
15 mobility1 = Box(label="mob1")
16 node2 = Box(label="node2")
17 mobility2 = Box(label="mob2")
18 iface1 = Box(label="iface1")
19 iface2 = Box(label="iface2")
20 channel = Box(label="chan")
23 node1.connect(mobility1)
25 channel.connect(iface1)
26 channel.connect(iface2)
28 node2.connect(mobility2)
30 plotter = Plotter(node1)
31 fname = plotter.plot()
32 subprocess.call(["dot", "-Tps", fname, "-o", "%s.ps"%fname])
33 subprocess.call(["evince","%s.ps"%fname])
35 if __name__ == '__main__':