From e1012e314d6c21ad1b75082a292506cd751a9117 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 2 Aug 2018 21:42:01 +0200 Subject: o Fixing a bad bug and learning some Python: list.insert(index, value) will only insert at index if the list is index long. If not it will just append them. Yay. Much better digikey part data now. Creating a ValueList that automatically expands the list. o Stopping with silly key and value replacements. o Updating tests. --- test/doit/test_doit.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/doit/test_doit.py b/test/doit/test_doit.py index 6f70c6b..fc13192 100644 --- a/test/doit/test_doit.py +++ b/test/doit/test_doit.py @@ -1,21 +1,20 @@ import inspect import os -import os.path -import logging -from pathlib import Path -from ee.ds import DataSetManager +import pathlib from inspect import Parameter -import ee.kicad.doit -import ee.digikey.doit -from ee.kicad.doit import * +import ee.digikey.doit +import ee.kicad.doit from ee.digikey.doit import * +from ee.ds import DataSetManager +from ee.kicad.doit import * logger = logging.getLogger(__name__) -file_dir = Path(__file__).parent +file_dir = pathlib.Path(__file__).parent schematics_dir = file_dir / "schematics" + def exec_task(task): targets = task["targets"] for a in task["actions"]: @@ -34,7 +33,7 @@ def exec_task(task): # noinspection SpellCheckingInspection def test_doit(tmpdir, caplog): - dsm = DataSetManager(os.path.join(tmpdir, "ee")) + dsm = DataSetManager(pathlib.Path(tmpdir) / "ee") dsm.register_ds("csv", "kicad-footprint", "kicad-footprint-mapping", path=schematics_dir / "ee" / "kicad-footprint.csv") @@ -44,7 +43,7 @@ def test_doit(tmpdir, caplog): lambda ds: ds + ["kicad-footprint"]) ee.kicad.doit.init(sch=schematics_dir / "schematic-1.sch", - kicad_pcb=schematics_dir / "schematic-1.kicad_pcb",) + kicad_pcb=schematics_dir / "schematic-1.kicad_pcb", ) ee.digikey.doit.doit_config.configure(data_set_manager=dsm) @@ -52,3 +51,4 @@ def test_doit(tmpdir, caplog): exec_task(task_kicad_pcb_to_data_set()) exec_task(task_kicad_create_component_data_set()) exec_task(task_digikey_resolve_schematic_components()) + exec_task(task_digikey_fetch_full_part_facts()) -- cgit v1.2.3