From 979b3bc0d7649c0fadf24366094f5fa0f5d31861 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 26 May 2020 13:52:04 -0300 Subject: [PATCH] Added a test for missing output.layers --- tests/test_plot/test_yaml_errors.py | 15 ++++++++--- .../yaml_samples/error_no_layers.kiplot.yaml | 25 +++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 tests/yaml_samples/error_no_layers.kiplot.yaml diff --git a/tests/test_plot/test_yaml_errors.py b/tests/test_plot/test_yaml_errors.py index e2d7c2e1..07014e5f 100644 --- a/tests/test_plot/test_yaml_errors.py +++ b/tests/test_plot/test_yaml_errors.py @@ -9,9 +9,11 @@ Tests various errors in the config file - Incorrect name - Inner.1, but no inner layers - Inner_1 (malformed) -- No output.name -- No output.type -- No output.options +- No output: + - name + - type + - options + - layers For debug information use: pytest-3 --log-cli-level debug @@ -96,3 +98,10 @@ def test_no_options(): ctx.run(EXIT_BAD_CONFIG) assert ctx.search_err("Output 'PDF' needs options") ctx.clean_up() + + +def test_no_layers(): + ctx = context.TestContext('ErrorNoLayers', '3Rs', 'error_no_layers', None) + ctx.run(EXIT_BAD_CONFIG) + assert ctx.search_err("You must specify the layers for `PDF`") + ctx.clean_up() diff --git a/tests/yaml_samples/error_no_layers.kiplot.yaml b/tests/yaml_samples/error_no_layers.kiplot.yaml new file mode 100644 index 00000000..e3abe195 --- /dev/null +++ b/tests/yaml_samples/error_no_layers.kiplot.yaml @@ -0,0 +1,25 @@ +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 +