Added tests to cover all the out_any_drill.py errors.

This commit is contained in:
Salvador E. Tropea 2020-06-30 22:57:59 -03:00
parent d926a5419e
commit be8339ddff
10 changed files with 246 additions and 7 deletions

View File

@ -83,20 +83,69 @@ def test_wrong_version_3():
ctx.clean_up()
def test_drill_map_no_type():
ctx = context.TestContext('ErrorDrillMapNoType', '3Rs', 'error_drill_map_no_type', None)
def test_drill_map_no_type_1():
ctx = context.TestContext('ErrorDrillMapNoType1', '3Rs', 'error_drill_map_no_type', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("Empty drill `map` section")
ctx.clean_up()
def test_drill_map_wrong_type():
ctx = context.TestContext('ErrorDrillMapWrongType', '3Rs', 'error_drill_map_wrong_type', None)
def test_drill_map_no_type_2():
ctx = context.TestContext('ErrorDrillMapNoType2', '3Rs', 'error_drill_map_no_type_2', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("drill `map` must contain a `type`")
ctx.clean_up()
def test_drill_map_wrong_type_1():
ctx = context.TestContext('ErrorDrillMapWrongType1', '3Rs', 'error_drill_map_wrong_type', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("Unknown drill `map` `type`: bogus")
ctx.clean_up()
def test_drill_map_wrong_type_2():
ctx = context.TestContext('ErrorDrillMapWrongType2', '3Rs', 'error_drill_map_wrong_type_2', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("drill `map` `type` must be a string")
ctx.clean_up()
def test_drill_map_wrong_type_3():
ctx = context.TestContext('ErrorDrillMapWrongType3', '3Rs', 'error_drill_map_wrong_type_3', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("drill `map` must be a string")
ctx.clean_up()
def test_drill_report_no_type_1():
ctx = context.TestContext('ErrorDrillReportNoType1', '3Rs', 'error_drill_report_no_type', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("Empty drill `report` section")
ctx.clean_up()
def test_drill_report_no_type_2():
ctx = context.TestContext('ErrorDrillReportNoType2', '3Rs', 'error_drill_report_no_type_2', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("drill `report` must contain a `filename`")
ctx.clean_up()
def test_drill_report_wrong_type_2():
ctx = context.TestContext('ErrorDrillReportWrongType2', '3Rs', 'error_drill_report_wrong_type_2', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("drill `report` `filename` must be a string")
ctx.clean_up()
def test_drill_report_wrong_type_3():
ctx = context.TestContext('ErrorDrillReportWrongType3', '3Rs', 'error_drill_report_wrong_type_3', None)
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("drill `report` must be a string")
ctx.clean_up()
def test_wrong_layer_1():
ctx = context.TestContext('ErrorWrongLayer1', '3Rs', 'error_wrong_layer_1', None)
ctx.run(PLOT_ERROR)

View File

@ -11,7 +11,7 @@ outputs:
options:
metric_units: true
pth_and_npth_single_file: false
use_aux_axis_as_origin: false
use_aux_axis_as_origin: true
minimal_header: false
mirror_y_axis: false
report:

View File

@ -14,8 +14,7 @@ outputs:
use_aux_axis_as_origin: false
minimal_header: false
mirror_y_axis: false
report:
filename: 'report.rpt'
report: None
map:
- name: gerber_drills

View File

@ -0,0 +1,28 @@
# Drills and Gerber drills
kiplot:
version: 1
outputs:
- name: excellon_drill
comment: "Excellon drill files"
type: excellon
dir: Drill
options:
metric_units: true
pth_and_npth_single_file: false
use_aux_axis_as_origin: false
minimal_header: false
mirror_y_axis: false
report:
filename: 'report.rpt'
map:
types: 'bogus'
- name: gerber_drills
comment: "Gerber drill files"
type: gerb_drill
dir: Drill
options:
use_aux_axis_as_origin: false

View File

@ -0,0 +1,28 @@
# Drills and Gerber drills
kiplot:
version: 1
outputs:
- name: excellon_drill
comment: "Excellon drill files"
type: excellon
dir: Drill
options:
metric_units: true
pth_and_npth_single_file: false
use_aux_axis_as_origin: false
minimal_header: false
mirror_y_axis: false
report:
filename: 'report.rpt'
map:
type: 5
- name: gerber_drills
comment: "Gerber drill files"
type: gerb_drill
dir: Drill
options:
use_aux_axis_as_origin: false

View File

@ -0,0 +1,27 @@
# Drills and Gerber drills
kiplot:
version: 1
outputs:
- name: excellon_drill
comment: "Excellon drill files"
type: excellon
dir: Drill
options:
metric_units: true
pth_and_npth_single_file: false
use_aux_axis_as_origin: false
minimal_header: false
mirror_y_axis: false
report:
filename: 'report.rpt'
map: true
- name: gerber_drills
comment: "Gerber drill files"
type: gerb_drill
dir: Drill
options:
use_aux_axis_as_origin: false

View File

@ -0,0 +1,26 @@
# Drills and Gerber drills
kiplot:
version: 1
outputs:
- name: excellon_drill
comment: "Excellon drill files"
type: excellon
dir: Drill
options:
metric_units: true
pth_and_npth_single_file: false
use_aux_axis_as_origin: false
minimal_header: false
mirror_y_axis: false
map: None
report:
- name: gerber_drills
comment: "Gerber drill files"
type: gerb_drill
dir: Drill
options:
use_aux_axis_as_origin: false

View File

@ -0,0 +1,28 @@
# Drills and Gerber drills
kiplot:
version: 1
outputs:
- name: excellon_drill
comment: "Excellon drill files"
type: excellon
dir: Drill
options:
metric_units: true
pth_and_npth_single_file: false
use_aux_axis_as_origin: false
minimal_header: false
mirror_y_axis: false
report:
filenames: 'report.rpt'
map:
type: 'bogus'
- name: gerber_drills
comment: "Gerber drill files"
type: gerb_drill
dir: Drill
options:
use_aux_axis_as_origin: false

View File

@ -0,0 +1,28 @@
# Drills and Gerber drills
kiplot:
version: 1
outputs:
- name: excellon_drill
comment: "Excellon drill files"
type: excellon
dir: Drill
options:
metric_units: true
pth_and_npth_single_file: false
use_aux_axis_as_origin: false
minimal_header: false
mirror_y_axis: false
report:
filename: 5
map:
type: 'pdf'
- name: gerber_drills
comment: "Gerber drill files"
type: gerb_drill
dir: Drill
options:
use_aux_axis_as_origin: false

View File

@ -0,0 +1,26 @@
# Drills and Gerber drills
kiplot:
version: 1
outputs:
- name: excellon_drill
comment: "Excellon drill files"
type: excellon
dir: Drill
options:
metric_units: true
pth_and_npth_single_file: false
use_aux_axis_as_origin: false
minimal_header: false
mirror_y_axis: false
map: 'pdf'
report: 5
- name: gerber_drills
comment: "Gerber drill files"
type: gerb_drill
dir: Drill
options:
use_aux_axis_as_origin: false