From 5a1a38a0cabb1f586b8d4bed5b4d35bd28da7f7d Mon Sep 17 00:00:00 2001 From: SET Date: Wed, 12 Aug 2020 17:34:05 -0300 Subject: [PATCH] Added test for missing field in column list (internal BoM) --- tests/test_plot/test_yaml_errors.py | 8 +++++++ .../error_int_bom_no_field.kiplot.yaml | 23 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/yaml_samples/error_int_bom_no_field.kiplot.yaml diff --git a/tests/test_plot/test_yaml_errors.py b/tests/test_plot/test_yaml_errors.py index 064843d5..5a6098a5 100644 --- a/tests/test_plot/test_yaml_errors.py +++ b/tests/test_plot/test_yaml_errors.py @@ -484,3 +484,11 @@ def test_unk_global(): assert ctx.search_err("Unknown global option") ctx.search_err("WARNING:Unknown global option") ctx.clean_up() + + +def test_error_int_bom_no_field(): + ctx = context.TestContextSCH('test_error_int_bom_no_field', 'links', 'error_int_bom_no_field', '') + ctx.run(EXIT_BAD_CONFIG) + assert ctx.search_err("Missing or empty `field` in columns list") + ctx.clean_up() + diff --git a/tests/yaml_samples/error_int_bom_no_field.kiplot.yaml b/tests/yaml_samples/error_int_bom_no_field.kiplot.yaml new file mode 100644 index 00000000..1b70da43 --- /dev/null +++ b/tests/yaml_samples/error_int_bom_no_field.kiplot.yaml @@ -0,0 +1,23 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in CSV format" + type: bom + dir: BoM + options: + columns: + - field: Row + name: Renglón + - name: Referencias + - field: Part + name: Componente + - field: Value + name: Valor + - field: digikey# + name: Código Digi-Key + - field: Quantity Per PCB + name: Cantidad por PCB +