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

Method test_write_bytes

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

Source from the content-addressed store, hash-verified

1215 self.assertEqual(ly2.top_cell().bbox().to_s(), "(0,10;20,30)")
1216
1217 def test_write_bytes(self):
1218
1219 ly = pya.Layout()
1220 top = ly.create_cell("TOP")
1221 l1 = ly.layer(1, 0)
1222 shape = top.shapes(l1).insert(pya.Box(0, 10, 20, 30))
1223 options = pya.SaveLayoutOptions()
1224 options.format = "GDS2"
1225 byte_buffer = ly.write_bytes(options)
1226
1227 ly2 = pya.Layout()
1228 ly2.read_bytes(byte_buffer)
1229 l2 = ly2.layer(1, 0)
1230 self.assertEqual(ly2.top_cell().bbox().to_s(), "(0,10;20,30)")
1231
1232 # Properties IDs
1233 def test_issue1549(self):

Callers

nothing calls this directly

Calls 9

LayoutMethod · 0.80
SaveLayoutOptionsMethod · 0.80
write_bytesMethod · 0.80
create_cellMethod · 0.45
layerMethod · 0.45
insertMethod · 0.45
BoxMethod · 0.45
to_sMethod · 0.45
bboxMethod · 0.45

Tested by

no test coverage detected