def testDrawDevice(self): icon = Icon("symbol-quadrupole.svg") device = Device("I-K01/VAC/I-K01CAB05-VAC-IPCU1", icon, (113, 122)) linac = Linac() linac.addSection("I-K01") linac.addDevice(device) blankSVGpath = 'blank.svg' svgTree = etree.parse(blankSVGpath) svgRoot = svgTree.getroot() svgFile = svg.SVG() svgFile.setSvg(svgRoot) device.updateSvg() vacNode = svgFile.getSubsystemZoomNode("VAC") deviceNode = svgFile.getElementById("ik01vacik01cab05vacipcu1", vacNode) self.assertEqual( deviceNode.attrib["{http://www.w3.org/1999/xlink}href"], "#symbol-quadrupole") descriptionNode = svgFile.getElementById( "ik01vacik01cab05vacipcu1Desc", deviceNode) self.assertEqual(descriptionNode.text, "device=I-K01/VAC/I-K01CAB05-VAC-IPCU1")