From e81981db5623f4f88def46e06e3cb87f342cea29 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 19 May 2020 11:40:55 -0300 Subject: [PATCH] Added a test for print_sch --- tests/test_plot/test_print_sch.py | 32 ++++++++++++++++++++++++ tests/yaml_samples/print_sch.kiplot.yaml | 12 +++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/test_plot/test_print_sch.py create mode 100644 tests/yaml_samples/print_sch.kiplot.yaml diff --git a/tests/test_plot/test_print_sch.py b/tests/test_plot/test_print_sch.py new file mode 100644 index 00000000..4e6d4160 --- /dev/null +++ b/tests/test_plot/test_print_sch.py @@ -0,0 +1,32 @@ +""" +Tests of Printing Schematic files + +We test: +- PDF for bom.sch + +For debug information use: +pytest-3 --log-cli-level debug + +""" + +import os +import sys +# Look for the 'utils' module from where the script is running +script_dir = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, os.path.dirname(script_dir)) +# Utils import +from utils import context + +PDF_DIR = '' +PDF_FILE = 'Schematic.pdf' + + +def test_print_sch(): + prj = 'bom' + ctx = context.TestContext('PrSCH', prj, 'print_sch', PDF_DIR) + ctx.run() + # Check all outputs are there + ctx.expect_out_file(PDF_FILE) + # We don't have a project, and we don't want one + os.remove(os.path.join(ctx.get_board_dir(), prj+'.pro')) + ctx.clean_up() diff --git a/tests/yaml_samples/print_sch.kiplot.yaml b/tests/yaml_samples/print_sch.kiplot.yaml new file mode 100644 index 00000000..b1910584 --- /dev/null +++ b/tests/yaml_samples/print_sch.kiplot.yaml @@ -0,0 +1,12 @@ +# Example KiPlot config file +kiplot: + version: 1 + +outputs: + - name: 'print_sch' + comment: "Print schematic (PDF)" + type: pdf_sch_print + dir: . + options: + output: Schematic.pdf +