Better test for multiple digikey links
This commit is contained in:
parent
ec821f7809
commit
eef8041843
|
|
@ -25,6 +25,7 @@ F 2 "" H 2850 2300 50 0001 C CNN
|
|||
F 3 "https://www.molex.com/webdocs/datasheets/pdf/en-us//0022232021_PCB_HEADERS.pdf" H 2850 2300 50 0001 C CNN
|
||||
F 4 "900-0022232021-ND" H 2850 2300 50 0001 C CNN "digikey#"
|
||||
F 5 "0022232021" H 2850 2300 50 0001 C CNN "manf#"
|
||||
F 6 "WM2700-ND" H 2850 2300 50 0001 C CNN "digikey_alt#"
|
||||
1 2850 2300
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
|
|
@ -38,6 +39,7 @@ F 2 "" H 4500 2300 50 0001 C CNN
|
|||
F 3 "https://www.molex.com/webdocs/datasheets/pdf/en-us//0022232021_PCB_HEADERS.pdf" H 4500 2300 50 0001 C CNN
|
||||
F 4 "900-0022232021-ND" H 4500 2300 50 0001 C CNN "digikey#"
|
||||
F 5 "0022232021" H 4500 2300 50 0001 C CNN "manf#"
|
||||
F 6 "WM2700-ND" H 4500 2300 50 0001 C CNN "digikey_alt#"
|
||||
1 4500 2300
|
||||
-1 0 0 -1
|
||||
$EndComp
|
||||
|
|
@ -51,6 +53,7 @@ F 2 "" V 3380 2300 50 0001 C CNN
|
|||
F 3 "https://www.bourns.com/docs/product-datasheets/CRxxxxx.pdf" H 3450 2300 50 0001 C CNN
|
||||
F 4 "CR0805-JW-102ELFCT-ND" V 3450 2300 50 0001 C CNN "digikey#"
|
||||
F 5 "CR0805-JW-102ELF" V 3450 2300 50 0001 C CNN "manf#"
|
||||
F 6 "CRS0805-JX-102ELFCT-ND" V 3450 2300 50 0001 C CNN "digikey_alt#"
|
||||
1 3450 2300
|
||||
0 1 1 0
|
||||
$EndComp
|
||||
|
|
@ -65,6 +68,7 @@ F 3 "https://content.kemet.com/datasheets/KEM_C1002_X7R_SMD.pdf" H 3750 2500 50
|
|||
F 4 "399-1147-1-ND" H 3750 2500 50 0001 C CNN "digikey#"
|
||||
F 5 "C0805C102K5RACTU" H 3750 2500 50 0001 C CNN "manf#"
|
||||
F 6 "DNF" H 3750 2500 50 0001 C CNN "Config"
|
||||
F 7 "399-1149-1-ND" H 3750 2500 50 0001 C CNN "digikey_alt#"
|
||||
1 3750 2500
|
||||
1 0 0 -1
|
||||
$EndComp
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ KIBOM_TEST_COMPONENTS_ALT = ['C1-C4', 'R9-R10', 'R7', 'R8', 'R1-R5']
|
|||
KIBOM_TEST_COMPONENTS_ALT2 = ['C1-C4', 'R9-R10', 'R7', 'R8', 'R1-R2', 'R4-R5', 'R3']
|
||||
KIBOM_TEST_EXCLUDE = ['R6']
|
||||
KIBOM_TEST_GROUPS = 5
|
||||
LINK_HEAD = ['References', 'Part', 'Value', 'Quantity Per PCB', 'digikey#', 'manf#']
|
||||
LINK_HEAD = ['References', 'Part', 'Value', 'Quantity Per PCB', 'digikey#', 'digikey_alt#','manf#']
|
||||
LINKS_COMPONENTS = ['J1', 'J2', 'R1']
|
||||
LINKS_EXCLUDE = ['C1']
|
||||
LINKS_GROUPS = 2
|
||||
|
|
@ -326,6 +326,41 @@ def test_int_bom_digikey_link():
|
|||
ctx.clean_up()
|
||||
|
||||
|
||||
def test_int_bom_digikey_links():
|
||||
prj = 'links'
|
||||
ext = 'html'
|
||||
ctx = context.TestContextSCH('test_int_bom_digikey_links', prj, 'int_bom_digikey_links', BOM_DIR)
|
||||
ctx.run()
|
||||
out = prj + '.' + ext
|
||||
rows, headers = ctx.load_html(out)
|
||||
# Test we got the normal and DNF tables
|
||||
assert len(rows) == 2
|
||||
assert len(headers) == 2
|
||||
# Test both tables has the same headings and they are the expected
|
||||
assert headers[0] == headers[1]
|
||||
assert headers[0] == LINK_HEAD
|
||||
# Look for reference and quantity columns
|
||||
ref_column = headers[0].index(REF_COLUMN_NAME)
|
||||
dk_column = headers[0].index('digikey#')
|
||||
dk2_column = headers[0].index('digikey_alt#')
|
||||
# Check the normal table
|
||||
check_kibom_test_netlist(rows[0], ref_column, LINKS_GROUPS, LINKS_EXCLUDE, LINKS_COMPONENTS)
|
||||
# Check the DNF table
|
||||
check_kibom_test_netlist(rows[1], ref_column, 1, LINKS_COMPONENTS, LINKS_EXCLUDE)
|
||||
# Check the digikey link
|
||||
parts = get_column(rows[0]+rows[1], dk_column, False)
|
||||
for c in parts:
|
||||
assert c.strip().startswith('<a href')
|
||||
assert 'digikey' in c
|
||||
logging.debug(c + ' OK')
|
||||
parts = get_column(rows[0]+rows[1], dk2_column, False)
|
||||
for c in parts:
|
||||
assert c.strip().startswith('<a href')
|
||||
assert 'digikey' in c
|
||||
logging.debug(c + ' OK')
|
||||
ctx.clean_up()
|
||||
|
||||
|
||||
def test_int_bom_join_1():
|
||||
prj = 'join'
|
||||
ext = 'csv'
|
||||
|
|
@ -840,3 +875,35 @@ def test_int_bom_digikey_link_xlsx():
|
|||
assert 'digikey' in c
|
||||
logging.debug(c + ' OK')
|
||||
ctx.clean_up()
|
||||
|
||||
|
||||
def test_int_bom_digikey_links_xlsx():
|
||||
prj = 'links'
|
||||
ext = 'xlsx'
|
||||
ctx = context.TestContextSCH('test_int_bom_digikey_links_xlsx', prj, 'int_bom_digikey_links_xlsx', BOM_DIR)
|
||||
ctx.run()
|
||||
out = prj + '.' + ext
|
||||
rows, headers, sh_head = ctx.load_xlsx(out)
|
||||
assert headers == LINK_HEAD
|
||||
# Look for reference and quantity columns
|
||||
ref_column = headers.index(REF_COLUMN_NAME)
|
||||
dk_column = headers.index('digikey#')
|
||||
dk2_column = headers.index('digikey_alt#')
|
||||
# Check the normal table
|
||||
check_kibom_test_netlist(rows, ref_column, LINKS_GROUPS, LINKS_EXCLUDE, LINKS_COMPONENTS)
|
||||
rows2, headers, sh_head = ctx.load_xlsx(out, 2)
|
||||
assert headers == LINK_HEAD
|
||||
# Check the DNF table
|
||||
check_kibom_test_netlist(rows2, ref_column, 1, LINKS_COMPONENTS, LINKS_EXCLUDE)
|
||||
# Check the datasheet link
|
||||
parts = get_column(rows+rows2, dk_column, False)
|
||||
for c in parts:
|
||||
assert c.strip().startswith('<a href')
|
||||
assert 'digikey' in c
|
||||
logging.debug(c + ' OK')
|
||||
parts = get_column(rows+rows2, dk2_column, False)
|
||||
for c in parts:
|
||||
assert c.strip().startswith('<a href')
|
||||
assert 'digikey' in c
|
||||
logging.debug(c + ' OK')
|
||||
ctx.clean_up()
|
||||
|
|
|
|||
|
|
@ -17,4 +17,5 @@ outputs:
|
|||
- Value
|
||||
- Quantity Per PCB
|
||||
- digikey#
|
||||
- digikey_alt#
|
||||
- manf#
|
||||
|
|
|
|||
|
|
@ -17,4 +17,5 @@ outputs:
|
|||
- Value
|
||||
- Quantity Per PCB
|
||||
- digikey#
|
||||
- digikey_alt#
|
||||
- manf#
|
||||
|
|
|
|||
|
|
@ -17,4 +17,5 @@ outputs:
|
|||
- Value
|
||||
- Quantity Per PCB
|
||||
- digikey#
|
||||
- digikey_alt#
|
||||
- manf#
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ outputs:
|
|||
dir: BoM
|
||||
options:
|
||||
xlsx:
|
||||
digikey_link: ['digikey#', 'Value']
|
||||
digikey_link: 'digikey#'
|
||||
output: '%f.%x'
|
||||
columns:
|
||||
- References
|
||||
|
|
@ -17,4 +17,5 @@ outputs:
|
|||
- Value
|
||||
- Quantity Per PCB
|
||||
- digikey#
|
||||
- digikey_alt#
|
||||
- manf#
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
# Example KiPlot config file
|
||||
kiplot:
|
||||
version: 1
|
||||
|
||||
outputs:
|
||||
- name: 'bom_internal'
|
||||
comment: "Bill of Materials in HTML format"
|
||||
type: bom
|
||||
dir: BoM
|
||||
options:
|
||||
html:
|
||||
digikey_link: ['digikey#', 'digikey_alt#']
|
||||
output: '%f.%x'
|
||||
columns:
|
||||
- References
|
||||
- Part
|
||||
- Value
|
||||
- Quantity Per PCB
|
||||
- digikey#
|
||||
- digikey_alt#
|
||||
- manf#
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# Example KiPlot config file
|
||||
kiplot:
|
||||
version: 1
|
||||
|
||||
outputs:
|
||||
- name: 'bom_internal'
|
||||
comment: "Bill of Materials in XLSX format"
|
||||
type: bom
|
||||
dir: BoM
|
||||
options:
|
||||
xlsx:
|
||||
digikey_link: ['digikey#', 'digikey_alt#']
|
||||
output: '%f.%x'
|
||||
columns:
|
||||
- References
|
||||
- Part
|
||||
- Value
|
||||
- Quantity Per PCB
|
||||
- digikey#
|
||||
- digikey_alt#
|
||||
- manf#
|
||||
Loading…
Reference in New Issue