From b2189991fc0486dd310b34b43923c0d356dcbe4d Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Sat, 1 Aug 2020 14:43:08 -0300 Subject: [PATCH] Added test for `number_rows` internal BoM option --- tests/test_plot/test_int_bom.py | 15 +++++++++++++++ .../int_bom_no_number_rows.kiplot.yaml | 13 +++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/yaml_samples/int_bom_no_number_rows.kiplot.yaml diff --git a/tests/test_plot/test_int_bom.py b/tests/test_plot/test_int_bom.py index 3abc35ff..db598eaf 100644 --- a/tests/test_plot/test_int_bom.py +++ b/tests/test_plot/test_int_bom.py @@ -299,6 +299,7 @@ def test_int_bom_html_generate_dnf(): def test_int_bom_use_alt(): + """ use_alt: true """ prj = 'kibom-test' ext = 'csv' ctx = context.TestContextSCH('test_int_bom_use_alt', prj, 'int_bom_use_alt', BOM_DIR) @@ -312,3 +313,17 @@ def test_int_bom_use_alt(): check_dnc(rows, 'R7', ref_column, qty_column) ctx.clean_up() + +def test_int_bom_no_number_rows(): + prj = 'kibom-test' + ext = 'csv' + ctx = context.TestContextSCH('test_int_bom_no_number_rows', prj, 'int_bom_no_number_rows', BOM_DIR) + ctx.run() + out = prj + '-bom.' + ext + rows, header = ctx.load_csv(out) + assert header == KIBOM_TEST_HEAD[1:] + ref_column = header.index(REF_COLUMN_NAME) + qty_column = header.index(QTY_COLUMN_NAME) + check_kibom_test_netlist(rows, ref_column, KIBOM_TEST_GROUPS, KIBOM_TEST_EXCLUDE, KIBOM_TEST_COMPONENTS) + check_dnc(rows, 'R7', ref_column, qty_column) + ctx.clean_up() diff --git a/tests/yaml_samples/int_bom_no_number_rows.kiplot.yaml b/tests/yaml_samples/int_bom_no_number_rows.kiplot.yaml new file mode 100644 index 00000000..5534d7e0 --- /dev/null +++ b/tests/yaml_samples/int_bom_no_number_rows.kiplot.yaml @@ -0,0 +1,13 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in CSV format" + type: bom + dir: BoM + options: + number_rows: false + format: CSV +