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

Method test_4

testdata/python/layLayers.py:788–819  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

786
787 # propagation of "real" attributes through the hierarchy
788 def test_4(self):
789
790 if not can_create_layoutview():
791 print("Skipped test as LayoutView cannot be created.")
792 return
793
794 cv = pya.LayoutView()
795 cv.load_layout(os.getenv("TESTSRC") + "/testdata/gds/t11.gds", True)
796 cv.load_layout(os.getenv("TESTSRC") + "/testdata/gds/t10.gds", True)
797
798 cv.clear_layers()
799
800 pos = cv.end_layers()
801 self.assertEqual(pos.current().is_valid(), False)
802
803 cv.insert_layer(pos, pya.LayerProperties())
804
805 new_p = pya.LayerProperties()
806 new_p.source = "1/0@1"
807 pos.current().add_child(new_p)
808
809 self.assertEqual(pos.current().visible_(True), True)
810 self.assertEqual(pos.current().visible_(False), True)
811 self.assertEqual(pos.first_child().current().visible_(True), True)
812 self.assertEqual(pos.first_child().current().visible_(False), True)
813 pos.current().visible = False
814 self.assertEqual(pos.current().visible_(True), False)
815 self.assertEqual(pos.current().visible_(False), False)
816 self.assertEqual(pos.first_child().current().visible_(True), False)
817 self.assertEqual(pos.first_child().current().visible_(False), True)
818
819 cv._destroy()
820
821 # delete method of iterator
822 def test_5(self):

Callers

nothing calls this directly

Calls 10

clear_layersMethod · 0.80
end_layersMethod · 0.80
can_create_layoutviewFunction · 0.70
LayoutViewMethod · 0.45
load_layoutMethod · 0.45
is_validMethod · 0.45
currentMethod · 0.45
insert_layerMethod · 0.45
LayerPropertiesMethod · 0.45
add_childMethod · 0.45

Tested by

no test coverage detected