From f229956b25099063cb77130b7190f4fcfdd82277 Mon Sep 17 00:00:00 2001 From: SET Date: Tue, 11 Aug 2020 19:09:44 -0300 Subject: [PATCH] Added test for DNC in value and in Config --- tests/board_samples/kibom-test-rep.sch | 23 +++++++++++++++++++++++ tests/test_plot/test_int_bom.py | 6 ++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/tests/board_samples/kibom-test-rep.sch b/tests/board_samples/kibom-test-rep.sch index 2185c5e4..114acd30 100644 --- a/tests/board_samples/kibom-test-rep.sch +++ b/tests/board_samples/kibom-test-rep.sch @@ -75,4 +75,27 @@ F 4 "" H 2900 3600 50 0001 C CNN "Config" 5 2900 3600 1 0 0 -1 $EndComp +$Comp +L Device:R R1 +U 1 1 5F331BEB +P 4200 2000 +F 0 "R1" H 4270 2046 50 0000 L CNN +F 1 "DNC" H 4270 1955 50 0000 L CNN +F 2 "" V 4130 2000 50 0001 C CNN +F 3 "~" H 4200 2000 50 0001 C CNN + 1 4200 2000 + 1 0 0 -1 +$EndComp +$Comp +L Device:R R2 +U 1 1 5F3321E0 +P 4200 2350 +F 0 "R2" H 4270 2396 50 0000 L CNN +F 1 "100" H 4270 2305 50 0000 L CNN +F 2 "" V 4130 2350 50 0001 C CNN +F 3 "~" H 4200 2350 50 0001 C CNN +F 4 "DNF, DNC" H 4200 2350 50 0001 C CNN "Config" + 1 4200 2350 + 1 0 0 -1 +$EndComp $EndSCHEMATC diff --git a/tests/test_plot/test_int_bom.py b/tests/test_plot/test_int_bom.py index bdb12485..9b6fe328 100644 --- a/tests/test_plot/test_int_bom.py +++ b/tests/test_plot/test_int_bom.py @@ -31,7 +31,6 @@ Tests of Internal BoM files Missing: - Variants -- test_regex - number_boards - hide_headers - hide_pcb_info @@ -540,7 +539,10 @@ def test_int_bom_repeat_csv(): out = prj + '-bom.' + ext rows, header = ctx.load_csv(out) assert header == KIBOM_TEST_HEAD - check_kibom_test_netlist(rows, header.index(REF_COLUMN_NAME), 1, [], ['U1']) + ref_column = header.index(REF_COLUMN_NAME) + qty_column = header.index(QTY_COLUMN_NAME) + check_kibom_test_netlist(rows, ref_column, 2, ['R2'], ['U1', 'R1']) + check_dnc(rows, 'R1', ref_column, qty_column) ctx.clean_up()