Added 3 tests for wrong layer names.

This commit is contained in:
Salvador E. Tropea 2020-05-26 13:27:49 -03:00
parent 4e14891979
commit 31e461ca9c
4 changed files with 113 additions and 1 deletions

View File

@ -5,6 +5,10 @@ Tests various errors in the config file
- Wrong kiplot.version
- Missing drill map type
- Wrong drill map type
- Wrong layer:
- Incorrect name
- Inner.1, but no inner layers
- Inner_1 (malformed)
For debug information use:
pytest-3 --log-cli-level debug
@ -18,7 +22,7 @@ sys.path.insert(0, os.path.dirname(prev_dir))
# Utils import
from utils import context
sys.path.insert(0, os.path.dirname(prev_dir))
from kiplot.misc import (EXIT_BAD_CONFIG)
from kiplot.misc import (EXIT_BAD_CONFIG, PLOT_ERROR)
def test_no_version():
@ -47,3 +51,24 @@ def test_drill_map_wrong_type():
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("Unknown drill map type: bogus")
ctx.clean_up()
def test_wrong_layer_1():
ctx = context.TestContext('ErrorWrongLayer1', '3Rs', 'error_wrong_layer_1', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("Unknown layer name: F.Bogus")
ctx.clean_up()
def test_wrong_layer_2():
ctx = context.TestContext('ErrorWrongLayer2', '3Rs', 'error_wrong_layer_2', None)
ctx.run(PLOT_ERROR)
assert ctx.search_err("Inner layer 1 is not valid for this board")
ctx.clean_up()
def test_wrong_layer_3():
ctx = context.TestContext('ErrorWrongLayer3', '3Rs', 'error_wrong_layer_3', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("Malformed inner layer name: Inner_1,")
ctx.clean_up()

View File

@ -0,0 +1,29 @@
kiplot:
version: 1
outputs:
- name: PDF
comment: "PDF files"
type: pdf
dir: PDF
options:
exclude_edge_layer: false
exclude_pads_from_silkscreen: false
use_aux_axis_as_origin: false
plot_sheet_reference: false
plot_footprint_refs: true
plot_footprint_values: true
force_plot_invisible_refs_vals: false
tent_vias: true
check_zone_fills: true
# PDF options
drill_marks: small
mirror_plot: false
negative_plot: false
line_width: 0.01
layers:
- layer: F.Cu
suffix: F_Cu
- layer: F.Bogus
suffix: B_Silks

View File

@ -0,0 +1,29 @@
kiplot:
version: 1
outputs:
- name: PDF
comment: "PDF files"
type: pdf
dir: PDF
options:
exclude_edge_layer: false
exclude_pads_from_silkscreen: false
use_aux_axis_as_origin: false
plot_sheet_reference: false
plot_footprint_refs: true
plot_footprint_values: true
force_plot_invisible_refs_vals: false
tent_vias: true
check_zone_fills: true
# PDF options
drill_marks: small
mirror_plot: false
negative_plot: false
line_width: 0.01
layers:
- layer: F.Cu
suffix: F_Cu
- layer: Inner.1
suffix: B_Silks

View File

@ -0,0 +1,29 @@
kiplot:
version: 1
outputs:
- name: PDF
comment: "PDF files"
type: pdf
dir: PDF
options:
exclude_edge_layer: false
exclude_pads_from_silkscreen: false
use_aux_axis_as_origin: false
plot_sheet_reference: false
plot_footprint_refs: true
plot_footprint_values: true
force_plot_invisible_refs_vals: false
tent_vias: true
check_zone_fills: true
# PDF options
drill_marks: small
mirror_plot: false
negative_plot: false
line_width: 0.01
layers:
- layer: F.Cu
suffix: F_Cu
- layer: Inner_1
suffix: B_Silks