From 4111131008d74557c4575dee1028538a66b23443 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 8 Jul 2020 16:47:07 -0300 Subject: [PATCH] Added test for run_erc not boolean. --- tests/test_plot/test_yaml_errors.py | 8 ++++++++ tests/yaml_samples/erc.kiplot.yaml | 9 +++++++-- tests/yaml_samples/error_pre_wrong_type_3.kiplot.yaml | 9 +++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 tests/yaml_samples/error_pre_wrong_type_3.kiplot.yaml diff --git a/tests/test_plot/test_yaml_errors.py b/tests/test_plot/test_yaml_errors.py index c9de1d5a..5a23111c 100644 --- a/tests/test_plot/test_yaml_errors.py +++ b/tests/test_plot/test_yaml_errors.py @@ -335,6 +335,14 @@ def test_error_wrong_type_2(): ctx.clean_up() +def test_error_wrong_type_3(): + """ run_erc = number """ + ctx = context.TestContext('ErrorWrongType3', PRJ, 'error_pre_wrong_type_3', '') + ctx.run(EXIT_BAD_CONFIG) + assert ctx.search_err("In preflight 'run_erc': must be boolean") + ctx.clean_up() + + def test_error_yaml(): ctx = context.TestContext('ErrorYAML', PRJ, 'error_yaml', '') ctx.run(EXIT_BAD_CONFIG) diff --git a/tests/yaml_samples/erc.kiplot.yaml b/tests/yaml_samples/erc.kiplot.yaml index cf2a3f4a..6dd08047 100644 --- a/tests/yaml_samples/erc.kiplot.yaml +++ b/tests/yaml_samples/erc.kiplot.yaml @@ -4,5 +4,10 @@ kiplot: preflight: run_erc: true - - + filters: + - filter: 'Ignore C3 pad 2 too close to anything' + number: 4 + regex: 'Pad 2 of C3' + - filter: 'Ignore unconnected pad 2 of C4' + number: 2 + regex: 'Pad 2 of C4' diff --git a/tests/yaml_samples/error_pre_wrong_type_3.kiplot.yaml b/tests/yaml_samples/error_pre_wrong_type_3.kiplot.yaml new file mode 100644 index 00000000..6f1018bd --- /dev/null +++ b/tests/yaml_samples/error_pre_wrong_type_3.kiplot.yaml @@ -0,0 +1,9 @@ +# Example KiPlot config file +kiplot: + version: 1 + +preflight: + update_xml: true + run_erc: 1 + +