Added test for empty list of group fields.

This commit is contained in:
SET 2020-08-11 13:21:50 -03:00
parent acfb74335b
commit d49d3b498f
2 changed files with 29 additions and 1 deletions

View File

@ -478,7 +478,7 @@ def test_int_bom_alias_nm_csv():
""" Component aliases and not merge blank fields """
prj = 'kibom-test-2'
ext = 'csv'
ctx = context.TestContextSCH('test_int_bom_alias_csv', prj, 'int_bom_alias_nm_csv', BOM_DIR)
ctx = context.TestContextSCH('test_int_bom_alias_nm_csv', prj, 'int_bom_alias_nm_csv', BOM_DIR)
ctx.run()
out = prj + '-bom.' + ext
rows, header = ctx.load_csv(out)
@ -489,3 +489,20 @@ def test_int_bom_alias_nm_csv():
check_kibom_test_netlist(rows, ref_column, KIBOM_TEST_GROUPS+1, KIBOM_TEST_EXCLUDE, KIBOM_TEST_COMPONENTS)
check_dnc(rows, 'R7', ref_column, qty_column)
ctx.clean_up()
def test_int_bom_no_group_csv():
""" Component aliases and not merge blank fields """
prj = 'kibom-test'
ext = 'csv'
ctx = context.TestContextSCH('test_int_bom_no_group_csv', prj, 'int_bom_no_group_csv', BOM_DIR)
ctx.run()
out = prj + '-bom.' + ext
rows, header = ctx.load_csv(out)
assert header == KIBOM_TEST_HEAD
ref_column = header.index(REF_COLUMN_NAME)
qty_column = header.index(QTY_COLUMN_NAME)
# R3 without footprint won't be merged with other 10K resistors
check_kibom_test_netlist(rows, ref_column, len(KIBOM_TEST_COMPONENTS), KIBOM_TEST_EXCLUDE, KIBOM_TEST_COMPONENTS)
check_dnc(rows, 'R7', ref_column, qty_column)
ctx.clean_up()

View File

@ -0,0 +1,11 @@
# Example KiPlot config file
kiplot:
version: 1
outputs:
- name: 'bom_internal'
comment: "Bill of Materials in CSV format"
type: bom
dir: BoM
options:
group_fields: []