def test_qgeometry_q_element_delete_component_id(self): """Test delete_component_id in QGeometryTables class in element_handler.py.""" design = designs.DesignPlanar() qgt = QGeometryTables(design) qgt.clear_all_tables() transmon_pocket = TransmonPocket(design, 'my_id') transmon_pocket.make() transmon_pocket.get_template_options(design) a_linestring = draw.LineString([[0, 0], [0, 1]]) a_poly = draw.rectangle(2, 2, 0, 0) qgt.add_qgeometry('path', 'my_id', {'n_sprial': a_linestring}, width=4000) qgt.add_qgeometry('poly', 'my_id', {'n_spira_etch': a_poly}, subtract=True) self.assertEqual(len(qgt.tables['path']), 1) self.assertEqual(len(qgt.tables['poly']), 1) qgt.delete_component_id('my_id') self.assertEqual(len(qgt.tables['path']), 0) self.assertEqual(len(qgt.tables['poly']), 0)
def test_qgeometry_get_all_unique_layers(self): """Test get_all_unique_layers functionality in elment_handler.py.""" design = designs.DesignPlanar() qgt = QGeometryTables(design) qgt.clear_all_tables() transmon_pocket = TransmonPocket(design, 'my_id') transmon_pocket.make() transmon_pocket.get_template_options(design) a_linestring = draw.LineString([[0, 0], [0, 1]]) a_poly = draw.rectangle(2, 2, 0, 0) qgt.add_qgeometry('path', 'my_id', {'n_sprial': a_linestring}, width=4000) qgt.add_qgeometry('poly', 'my_id', {'n_spira_etch': a_poly}, subtract=True) self.assertEqual(qgt.get_all_unique_layers('main'), [1]) self.assertEqual(qgt.get_all_unique_layers('fake'), [])
def test_renderer_get_chip_names(self): """Test functionality of get_chip_names in gds_renderer.py.""" design = designs.DesignPlanar() renderer = QGDSRenderer(design) qgt = QGeometryTables(design) qgt.clear_all_tables() transmon_pocket_1 = TransmonPocket(design, 'my_id') transmon_pocket_1.make() transmon_pocket_1.get_template_options(design) a_linestring = draw.LineString([[0, 0], [0, 1]]) a_poly = draw.rectangle(2, 2, 0, 0) qgt.add_qgeometry('path', 'my_id', {'n_sprial': a_linestring}, width=4000) qgt.add_qgeometry('poly', 'my_id', {'n_spira_etch': a_poly}, subtract=True) result = renderer._get_chip_names() self.assertEqual(result, {'main': {}})