Implemented #429: final touches to doc and tests for RBA/pya API.

This commit is contained in:
Matthias Koefferlein
2019-12-01 16:41:27 +01:00
parent 152dc87682
commit baffb940d1
6 changed files with 100 additions and 42 deletions
+39
View File
@@ -178,6 +178,45 @@ class DBReaders_TestClass < TestBase
end
# MAG Options
def test_mag_options
opt = RBA::LoadLayoutOptions::new
lm = RBA::LayerMap::new
lm.map(RBA::LayerInfo::new(1, 0), 2, RBA::LayerInfo::new(42, 17))
opt.mag_set_layer_map(lm, true)
assert_equal(opt.mag_layer_map.to_string, "1/0 : 42/17\n")
assert_equal(opt.mag_create_other_layers?, true)
opt.mag_create_other_layers = false
assert_equal(opt.mag_create_other_layers?, false)
opt.mag_select_all_layers
assert_equal(opt.mag_layer_map.to_string, "")
assert_equal(opt.mag_create_other_layers?, true)
opt.mag_keep_layer_names = true
assert_equal(opt.mag_keep_layer_names?, true)
opt.mag_keep_layer_names = false
assert_equal(opt.mag_keep_layer_names?, false)
opt.mag_dbu = 0.5
assert_equal(opt.mag_dbu, 0.5)
opt.mag_lambda = 0.125
assert_equal(opt.mag_lambda, 0.125)
assert_equal(opt.mag_merge, true)
opt.mag_merge = false
assert_equal(opt.mag_merge?, false)
assert_equal(opt.mag_library_paths, [])
opt.mag_library_paths = [ "a", "b" ]
assert_equal(opt.mag_library_paths, [ "a", "b" ])
end
end
load("test_epilogue.rb")
+9 -1
View File
@@ -118,7 +118,6 @@ class SaveLayoutOptions_TestClass < TestBase
opt.gds2_write_timestamps = false
assert_equal(opt.gds2_write_timestamps?, false)
# DXF+CIF attributes are kept with GDS2
assert_equal(opt.dxf_polygon_mode, 2)
opt.oasis_compression_level = 5
@@ -157,6 +156,15 @@ class SaveLayoutOptions_TestClass < TestBase
opt.oasis_substitution_char = "+"
assert_equal(opt.oasis_substitution_char, "+")
opt.mag_lambda = 0.25
assert_equal(opt.mag_lambda, 0.25)
assert_equal(opt.mag_write_timestamp?, true)
opt.mag_write_timestamp = false
assert_equal(opt.mag_write_timestamp?, false)
opt.mag_tech = "xyz"
assert_equal(opt.mag_tech, "xyz")
opt.set_format_from_filename("a.gds")
assert_equal(opt.format, "GDS2")