diff --git a/tests/test_plot/test_int_bom.py b/tests/test_plot/test_int_bom.py index a6db77eb..99ae55db 100644 --- a/tests/test_plot/test_int_bom.py +++ b/tests/test_plot/test_int_bom.py @@ -258,6 +258,7 @@ def test_int_bom_join_1(): def test_int_include_dnf(): + """ ignore_dnf: false """ prj = 'kibom-test' ext = 'csv' ctx = context.TestContextSCH('test_int_include_dnf', prj, 'int_bom_include_dnf', BOM_DIR) @@ -270,3 +271,28 @@ def test_int_include_dnf(): check_kibom_test_netlist(rows, ref_column, KIBOM_TEST_GROUPS+1, [], KIBOM_TEST_COMPONENTS+KIBOM_TEST_EXCLUDE) check_dnc(rows, 'R7', ref_column, qty_column) ctx.clean_up() + + +def test_int_bom_html_generate_dnf(): + """ html_generate_dnf: false """ + prj = 'kibom-test' + ext = 'html' + ctx = context.TestContextSCH('test_int_bom_html_generate_dnf', prj, 'int_bom_html_generate_dnf', BOM_DIR) + ctx.run() + out = prj + '-bom.' + ext + rows, headers = ctx.load_html(out) + logging.debug(rows) + # Test we got the normal and DNF tables + assert len(rows) == 1 + assert len(headers) == 1 + # Test both tables has the same headings and they are the expected + head_no_comp = deepcopy(KIBOM_TEST_HEAD) + head_no_comp[0] = '' # HTML numbered column doesn't have a name + assert headers[0] == head_no_comp + # Look for reference and quantity columns + ref_column = headers[0].index(REF_COLUMN_NAME) + qty_column = headers[0].index(QTY_COLUMN_NAME) + check_kibom_test_netlist(rows[0], ref_column, KIBOM_TEST_GROUPS, KIBOM_TEST_EXCLUDE, KIBOM_TEST_COMPONENTS) + check_dnc(rows[0], 'R7', ref_column, qty_column) + ctx.clean_up() + diff --git a/tests/utils/context.py b/tests/utils/context.py index c58a5848..ff50b105 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -363,11 +363,13 @@ class TestContext(object): file = self.expect_out_file(os.path.join(self.sub_dir, filename)) with open(file) as f: html = f.read() - rows = [[], []] - headers = [[], []] + rows = [] + headers = [] c = 0 for body in re.findall(r'