From 1042edbb0e214501101125094366088a7cebbc3f Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 21 Sep 2022 12:41:30 -0300 Subject: [PATCH] [Update_XML] Correct error when using wrong value --- kibot/pre_update_xml.py | 2 ++ tests/board_samples/kicad_6/.gitignore | 1 + tests/test_plot/test_yaml_errors.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kibot/pre_update_xml.py b/kibot/pre_update_xml.py index b2d57d71..2151a361 100644 --- a/kibot/pre_update_xml.py +++ b/kibot/pre_update_xml.py @@ -59,6 +59,8 @@ class Update_XML(BasePreFlight): # noqa: F821 self._check_pcb_parity = f.check_pcb_parity self.options = f self._pcb_related = True + else: + raise KiPlotConfigurationError('must be boolean or dict') self._sch_related = True @classmethod diff --git a/tests/board_samples/kicad_6/.gitignore b/tests/board_samples/kicad_6/.gitignore index ef7e3624..dcde1b9e 100644 --- a/tests/board_samples/kicad_6/.gitignore +++ b/tests/board_samples/kicad_6/.gitignore @@ -4,3 +4,4 @@ test_v5/ zone-refill.pro fp-info-cache *-bak +pcb_parity.xml diff --git a/tests/test_plot/test_yaml_errors.py b/tests/test_plot/test_yaml_errors.py index 6cf6f150..3d0683c6 100644 --- a/tests/test_plot/test_yaml_errors.py +++ b/tests/test_plot/test_yaml_errors.py @@ -350,7 +350,7 @@ def test_error_wrong_type_3(test_dir): def test_error_wrong_type_4(test_dir): """ update_xml = number """ - ctx = context.TestContext(test_dir, PRJ, 'error_pre_wrong_type_4') + ctx = context.TestContextSCH(test_dir, 'bom', 'error_pre_wrong_type_4') ctx.run(EXIT_BAD_CONFIG) assert ctx.search_err("In preflight 'update_xml': must be boolean") ctx.clean_up(keep_project=True)