3 from neco.design.box import Box
4 from neco.util.plot import Plotter
9 class BoxPlotTestCase(unittest.TestCase):
11 node1 = Box(label="node1")
12 ping1 = Box(label="ping")
13 mobility1 = Box(label="mob1")
14 node2 = Box(label="node2")
15 mobility2 = Box(label="mob2")
16 iface1 = Box(label="iface1")
17 iface2 = Box(label="iface2")
18 channel = Box(label="chan")
21 node1.connect(mobility1)
23 channel.connect(iface1)
24 channel.connect(iface2)
26 node2.connect(mobility2)
28 plotter = Plotter(node1)
29 fname = plotter.plot()
30 subprocess.call(["dot", "-Tps", fname, "-o", "%s.ps"%fname])
31 subprocess.call(["evince","%s.ps"%fname])
33 if __name__ == '__main__':