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

Method test_9

testdata/python/dbLayoutTest.py:952–977  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

950
951 # under construction and update
952 def test_9(self):
953
954 ly = pya.Layout()
955 l1 = ly.insert_layer(pya.LayerInfo(1, 0))
956 c1 = ly.create_cell("a")
957 self.assertEqual(ly.under_construction(), False)
958
959 s1 = c1.shapes(l1).insert(pya.Box(0, 500, 1000, 2000))
960 self.assertEqual(c1.bbox().to_s(), "(0,500;1000,2000)")
961
962 ly = pya.Layout()
963 ly.start_changes()
964 self.assertEqual(ly.under_construction(), True)
965 ly.start_changes()
966 self.assertEqual(ly.under_construction(), True)
967 l1 = ly.insert_layer(pya.LayerInfo(1, 0))
968 c1 = ly.create_cell("a")
969 s1 = c1.shapes(l1).insert(pya.Box(0, 500, 1000, 2000))
970 self.assertEqual(c1.bbox().to_s(), "()")
971 # while under_construction, an explicit update is required to update the cell's bbox
972 ly.update()
973 self.assertEqual(c1.bbox().to_s(), "(0,500;1000,2000)")
974 ly.end_changes()
975 self.assertEqual(ly.under_construction(), True)
976 ly.end_changes()
977 self.assertEqual(ly.under_construction(), False)
978
979 # Instance editing
980 def test_10(self):

Callers

nothing calls this directly

Calls 10

insert_layerMethod · 0.95
start_changesMethod · 0.95
updateMethod · 0.95
end_changesMethod · 0.95
LayoutMethod · 0.80
create_cellMethod · 0.45
insertMethod · 0.45
BoxMethod · 0.45
to_sMethod · 0.45
bboxMethod · 0.45

Tested by

no test coverage detected