MCPcopy Create free account
hub / github.com/KLayout/klayout / test_9

Method test_9

testdata/python/dbPCells.py:570–589  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

568 self.assertEqual(cell.begin_shapes_rec(ly.layer(5, 0)).shape().__str__(), "box (-100,-300;100,300)")
569
570 def test_9(self):
571
572 if not "PCellDeclarationHelper" in pya.__dict__:
573 return
574
575 # instantiate and register the library
576 tl = PCellTestLib3()
577
578 ly = pya.Layout(True)
579
580 li1 = find_layer(ly, "1/0")
581 self.assertEqual(li1 == None, True)
582
583 c1 = ly.create_cell("c1")
584
585 c2 = ly.create_cell("RecursivePCell", "PCellTestLib3", { "layer": pya.LayerInfo(1, 0), "level": 4, "line": pya.Edge(0, 0, 20000, 0) })
586 c1.insert(pya.CellInstArray(c2.cell_index(), pya.Trans()))
587
588 self.assertEqual(c2.display_title(), "PCellTestLib3.RecursivePCell(L=1/0,E=(0,0;20,0),LVL=4")
589 self.assertEqual(str(c1.dbbox()), "(0,0;20,5.774)")
590
591# run unit tests
592if __name__ == '__main__':

Callers

nothing calls this directly

Calls 8

strFunction · 0.85
LayoutMethod · 0.80
PCellTestLib3Class · 0.70
find_layerFunction · 0.70
create_cellMethod · 0.45
EdgeMethod · 0.45
insertMethod · 0.45
cell_indexMethod · 0.45

Tested by

no test coverage detected