From eb77e20f80f98455a1386879f836c632e5238161 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 26 May 2020 13:04:56 -0300 Subject: [PATCH] Added test for missing drill map type --- tests/test_plot/test_yaml_errors.py | 8 ++++++ .../error_drill_map_no_type.kiplot.yaml | 27 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tests/yaml_samples/error_drill_map_no_type.kiplot.yaml diff --git a/tests/test_plot/test_yaml_errors.py b/tests/test_plot/test_yaml_errors.py index c492739f..ee4f4dbe 100644 --- a/tests/test_plot/test_yaml_errors.py +++ b/tests/test_plot/test_yaml_errors.py @@ -3,6 +3,7 @@ Tests various errors in the config file - No kiplot.version - Wrong kiplot.version +- Missing drill map type For debug information use: pytest-3 --log-cli-level debug @@ -31,3 +32,10 @@ def test_wrong_version(): ctx.run(EXIT_BAD_CONFIG) assert ctx.search_err('Unknown KiPlot config version: 20') ctx.clean_up() + + +def test_drill_map_no_type(): + ctx = context.TestContext('ErrorDrillMapNoType', '3Rs', 'error_drill_map_no_type', None) + ctx.run(EXIT_BAD_CONFIG) + assert ctx.search_err("Missing `type' in drill map section") + ctx.clean_up() diff --git a/tests/yaml_samples/error_drill_map_no_type.kiplot.yaml b/tests/yaml_samples/error_drill_map_no_type.kiplot.yaml new file mode 100644 index 00000000..b78469bf --- /dev/null +++ b/tests/yaml_samples/error_drill_map_no_type.kiplot.yaml @@ -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: + + - name: gerber_drills + comment: "Gerber drill files" + type: gerb_drill + dir: Drill + options: + use_aux_axis_as_origin: false +