From ecbeb587fe2283dc5b66eb92eaea7f4a06e473d5 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Sat, 1 Aug 2020 13:35:42 -0300 Subject: [PATCH] Simplified the other internal BoM tests. Now that we can just use TestContextSCH. No need for dummy PCB or extra options. --- tests/board_samples/RLC_sort.kicad_pcb | 0 tests/board_samples/kibom-test.kicad_pcb | 0 tests/board_samples/links.kicad_pcb | 0 tests/test_plot/test_int_bom.py | 28 ++++++++++++------------ 4 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 tests/board_samples/RLC_sort.kicad_pcb delete mode 100644 tests/board_samples/kibom-test.kicad_pcb delete mode 100644 tests/board_samples/links.kicad_pcb diff --git a/tests/board_samples/RLC_sort.kicad_pcb b/tests/board_samples/RLC_sort.kicad_pcb deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/board_samples/kibom-test.kicad_pcb b/tests/board_samples/kibom-test.kicad_pcb deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/board_samples/links.kicad_pcb b/tests/board_samples/links.kicad_pcb deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/test_plot/test_int_bom.py b/tests/test_plot/test_int_bom.py index a8218846..e3956757 100644 --- a/tests/test_plot/test_int_bom.py +++ b/tests/test_plot/test_int_bom.py @@ -67,8 +67,8 @@ def check_dnc(rows, comp, ref, qty): def test_int_bom_simple_csv(): prj = 'kibom-test' ext = 'csv' - ctx = context.TestContext('test_int_bom_simple_csv', prj, 'int_bom_simple_csv', BOM_DIR) - ctx.run(no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), prj+'.sch')]) + ctx = context.TestContextSCH('test_int_bom_simple_csv', prj, 'int_bom_simple_csv', BOM_DIR) + ctx.run() out = prj + '-bom.' + ext rows, header = ctx.load_csv(out) assert header == KIBOM_TEST_HEAD @@ -82,8 +82,8 @@ def test_int_bom_simple_csv(): def test_int_bom_simple_html(): prj = 'kibom-test' ext = 'html' - ctx = context.TestContext('test_int_bom_simple_html', prj, 'int_bom_simple_html', BOM_DIR) - ctx.run(no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), prj+'.sch')]) + ctx = context.TestContextSCH('test_int_bom_simple_html', prj, 'int_bom_simple_html', BOM_DIR) + ctx.run() out = prj + '-bom.' + ext rows, headers = ctx.load_html(out) # Test we got the normal and DNF tables @@ -116,8 +116,8 @@ def adapt_xml(h): def test_int_bom_simple_xml(): prj = 'kibom-test' ext = 'xml' - ctx = context.TestContext('test_int_bom_simple_xml', prj, 'int_bom_simple_xml', BOM_DIR) - ctx.run(no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), prj+'.sch')]) + ctx = context.TestContextSCH('test_int_bom_simple_xml', prj, 'int_bom_simple_xml', BOM_DIR) + ctx.run() out = prj + '-bom.' + ext rows, header = ctx.load_xml(out) # Columns get sorted by name, so we need to take care of it @@ -135,8 +135,8 @@ def test_int_bom_simple_xml(): def test_int_bom_simple_xlsx(): prj = 'kibom-test' ext = 'xlsx' - ctx = context.TestContext('test_int_bom_simple_xlsx', prj, 'int_bom_simple_xlsx', BOM_DIR) - ctx.run(no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), prj+'.sch')]) + ctx = context.TestContextSCH('test_int_bom_simple_xlsx', prj, 'int_bom_simple_xlsx', BOM_DIR) + ctx.run() out = prj + '-bom.' + ext rows, header = ctx.load_xlsx(out) assert header == KIBOM_TEST_HEAD @@ -160,8 +160,8 @@ def get_column(rows, col, split=True): def test_int_bom_sort_1(): prj = 'RLC_sort' ext = 'csv' - ctx = context.TestContext('test_int_bom_sort_1', prj, 'int_bom_simple_csv', BOM_DIR) - ctx.run(no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), prj+'.sch')]) + ctx = context.TestContextSCH('test_int_bom_sort_1', prj, 'int_bom_simple_csv', BOM_DIR) + ctx.run() out = prj + '-bom.' + ext rows, header = ctx.load_csv(out) ref_column = header.index(REF_COLUMN_NAME) @@ -176,8 +176,8 @@ def test_int_bom_sort_1(): def test_int_bom_datasheet_link(): prj = 'links' ext = 'html' - ctx = context.TestContext('test_int_bom_datasheet_link', prj, 'int_bom_datasheet_link', BOM_DIR) - ctx.run(no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), prj+'.sch')]) + ctx = context.TestContextSCH('test_int_bom_datasheet_link', prj, 'int_bom_datasheet_link', BOM_DIR) + ctx.run() out = prj + '.' + ext rows, headers = ctx.load_html(out) # Test we got the normal and DNF tables @@ -206,8 +206,8 @@ def test_int_bom_datasheet_link(): def test_int_bom_digikey_link(): prj = 'links' ext = 'html' - ctx = context.TestContext('test_int_bom_digikey_link', prj, 'int_bom_digikey_link', BOM_DIR) - ctx.run(no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), prj+'.sch')]) + ctx = context.TestContextSCH('test_int_bom_digikey_link', prj, 'int_bom_digikey_link', BOM_DIR) + ctx.run() out = prj + '.' + ext rows, headers = ctx.load_html(out) # Test we got the normal and DNF tables