diff --git a/tests/test_plot/test_int_bom.py b/tests/test_plot/test_int_bom.py index fc94bc46..2b7e5dd7 100644 --- a/tests/test_plot/test_int_bom.py +++ b/tests/test_plot/test_int_bom.py @@ -391,6 +391,16 @@ def test_int_bom_simple_html_8(): logging.debug('Image content OK') +def test_int_bom_simple_html_9(): + """ No title, no logo, no info, no stats, custom style """ + (rows, headers, sh_head), prj, ctx = simple_html_setup('int_bom_simple_html_9') + style = ctx.load_html_style('kibom-test-bom.html') + with open('tests/data/html_style.css', 'rt') as f: + ref = f.read() + assert style[1:] == ref + simple_html_test(ctx, rows, headers, sh_head, prj, do_title=False, do_logo=False, do_info=False, do_stats=False) + + def adapt_xml(h): h = h.replace(' ', '_') h = h.replace('"', '') diff --git a/tests/utils/context.py b/tests/utils/context.py index fdfd8a7a..0475669e 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -462,6 +462,14 @@ class TestContext(object): rows.append(b) return rows, headers, sh_head + def load_html_style(self, filename): + file = self.expect_out_file(os.path.join(self.sub_dir, filename)) + with open(file) as f: + html = f.read() + m = re.search(r'', html, re.MULTILINE) + assert m + return m.group(1) + def load_xml(self, filename): rows = [] headers = None diff --git a/tests/yaml_samples/int_bom_simple_html_9.kiplot.yaml b/tests/yaml_samples/int_bom_simple_html_9.kiplot.yaml new file mode 100644 index 00000000..576e0226 --- /dev/null +++ b/tests/yaml_samples/int_bom_simple_html_9.kiplot.yaml @@ -0,0 +1,16 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'bom_internal' + comment: "Bill of Materials in HTML format" + type: bom + dir: BoM + options: + html: + logo: false + title: '' + hide_pcb_info: true + hide_stats_info: true + style: tests/data/html_style.css