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

Method test_dxf_options

testdata/python/dbReaders.py:89–142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

87
88 # DXF Options
89 def test_dxf_options(self):
90
91 opt = pya.LoadLayoutOptions()
92 lm = pya.LayerMap()
93 lm.map(pya.LayerInfo(1, 0), 2, pya.LayerInfo(42, 17))
94 opt.dxf_set_layer_map(lm, True)
95
96 self.assertEqual(opt.dxf_layer_map.to_string(), "1/0 : 42/17\n")
97 self.assertEqual(opt.dxf_create_other_layers, True)
98
99 opt.dxf_create_other_layers = False
100 self.assertEqual(opt.dxf_create_other_layers, False)
101
102 opt.dxf_select_all_layers()
103 self.assertEqual(opt.dxf_layer_map.to_string(), "")
104 self.assertEqual(opt.dxf_create_other_layers, True)
105
106 opt.dxf_dbu = 0.5
107 self.assertEqual(opt.dxf_dbu, 0.5)
108
109 opt.dxf_unit = 42
110 self.assertEqual(opt.dxf_unit, 42)
111
112 opt.dxf_text_scaling = 0.25
113 self.assertEqual(opt.dxf_text_scaling, 0.25)
114
115 opt.dxf_circle_points = 142
116 self.assertEqual(opt.dxf_circle_points, 142)
117
118 opt.dxf_circle_accuracy = 1.5
119 self.assertEqual(opt.dxf_circle_accuracy, 1.5)
120
121 opt.dxf_contour_accuracy = 0.75
122 self.assertEqual(opt.dxf_contour_accuracy, 0.75)
123
124 opt.dxf_render_texts_as_polygons = True
125 self.assertEqual(opt.dxf_render_texts_as_polygons, True)
126 opt.dxf_render_texts_as_polygons = False
127 self.assertEqual(opt.dxf_render_texts_as_polygons, False)
128
129 opt.dxf_keep_layer_names = True
130 self.assertEqual(opt.dxf_keep_layer_names, True)
131 opt.dxf_keep_layer_names = False
132 self.assertEqual(opt.dxf_keep_layer_names, False)
133
134 opt.dxf_keep_other_cells = True
135 self.assertEqual(opt.dxf_keep_other_cells, True)
136 opt.dxf_keep_other_cells = False
137 self.assertEqual(opt.dxf_keep_other_cells, False)
138
139 opt.dxf_polyline_mode = 2
140 self.assertEqual(opt.dxf_polyline_mode, 2)
141 opt.dxf_polyline_mode = 4
142 self.assertEqual(opt.dxf_polyline_mode, 4)
143
144 # CIF Options
145 def test_cif_options(self):

Callers

nothing calls this directly

Calls 4

LoadLayoutOptionsMethod · 0.80
LayerMapMethod · 0.80
mapMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected