From 535949e15911f6b3ac598b63baac1c3a8fff29b0 Mon Sep 17 00:00:00 2001 From: SET Date: Wed, 12 Aug 2020 20:10:34 -0300 Subject: [PATCH] Added test for explicit exclude_any regex --- tests/test_plot/test_int_bom.py | 17 ++++++++++++ .../int_bom_exclude_any.kiplot.yaml | 27 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/yaml_samples/int_bom_exclude_any.kiplot.yaml diff --git a/tests/test_plot/test_int_bom.py b/tests/test_plot/test_int_bom.py index 700a9205..a7840af1 100644 --- a/tests/test_plot/test_int_bom.py +++ b/tests/test_plot/test_int_bom.py @@ -740,6 +740,23 @@ def test_int_bom_collision(): ctx.clean_up() +def test_int_bom_exclude_any(): + """ Field collision and exclude_any """ + prj = 'kibom-test-3' + ext = 'csv' + ctx = context.TestContextSCH('test_int_bom_exclude_any', prj, 'int_bom_exclude_any', BOM_DIR) + ctx.run() + out = prj + '-bom.' + ext + rows, header = ctx.load_csv(out) + assert header == KIBOM_TEST_HEAD_TOL + ref_column = header.index(REF_COLUMN_NAME) + qty_column = header.index(QTY_COLUMN_NAME) + check_kibom_test_netlist(rows, ref_column, KIBOM_TEST_GROUPS+1, KIBOM_TEST_EXCLUDE, KIBOM_TEST_COMPONENTS+['X1']) + check_dnc(rows, 'R7', ref_column, qty_column) + ctx.search_err('Field conflict') + ctx.clean_up() + + def test_int_bom_include_only(): """ Include only (0805 components) """ prj = 'kibom-test' diff --git a/tests/yaml_samples/int_bom_exclude_any.kiplot.yaml b/tests/yaml_samples/int_bom_exclude_any.kiplot.yaml new file mode 100644 index 00000000..b750b5d2 --- /dev/null +++ b/tests/yaml_samples/int_bom_exclude_any.kiplot.yaml @@ -0,0 +1,27 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in CSV format" + type: bom + dir: BoM + options: + exclude_any: + - column: References + regex: '^TP[0-9]*' + - column: References + regex: '^FID' + - column: Part + regex: 'mount.*hole' + - column: Part + regex: 'solder.*bridge' + - column: Part + regex: 'solder.*jump' + - column: Part + regex: 'test.*point' + - column: Footprint + regex: 'test.*point' + - column: Footprint + regex: 'mount.*hole'