def test_write_net(self): """ The write_net method creates the correct kicad wires from an openjson net. """ net = Net('') p1 = NetPoint('p1', 0, 0) p2 = NetPoint('p2', 1, 0) p3 = NetPoint('p3', 0, 1) net.add_point(p1) net.add_point(p2) net.add_point(p3) net.conn_point(p1, p2) net.conn_point(p1, p3) writer = KiCAD() buf = StringIO() writer.write_net(buf, net) self.assertEqual( buf.getvalue(), 'Wire Wire Line\n\t0 0 0 -11\nWire Wire Line\n\t0 0 11 0\n')