aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-07-23 22:53:17 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2018-07-23 22:53:17 +0200
commit894ff92c770320e264961bba55bbf0fba16efe56 (patch)
tree1cd723415aaaf5ad45a7aa32ac77b4e8e5645db9 /test
parent3e5819caef56c449606e27ec80f9d563d519a907 (diff)
downloadee-python-894ff92c770320e264961bba55bbf0fba16efe56.tar.gz
ee-python-894ff92c770320e264961bba55bbf0fba16efe56.tar.bz2
ee-python-894ff92c770320e264961bba55bbf0fba16efe56.tar.xz
ee-python-894ff92c770320e264961bba55bbf0fba16efe56.zip
wip.
o Support for loading CSV files.
Diffstat (limited to 'test')
-rw-r--r--test/doit/schematics/ee/kicad-footprint.csv45
-rw-r--r--test/doit/test_doit.py25
2 files changed, 62 insertions, 8 deletions
diff --git a/test/doit/schematics/ee/kicad-footprint.csv b/test/doit/schematics/ee/kicad-footprint.csv
new file mode 100644
index 0000000..fa5cd5f
--- /dev/null
+++ b/test/doit/schematics/ee/kicad-footprint.csv
@@ -0,0 +1,45 @@
+kicad,common
+Capacitors_SMD:C_0402,0402
+Capacitors_SMD:C_0402_NoSilk,0402
+Capacitors_SMD:C_0603,0603
+Capacitors_SMD:C_0603_NoSilk,0603
+Capacitors_SMD:C_0805,0805
+Capacitors_SMD:C_0805_NoSilk,0805
+Diodes_SMD:D_SMA_Handsoldering,SMA
+Diodes_SMD:D_SMA,SMA
+Resistors_SMD:R_0402,0402
+Resistors_SMD:R_0402_NoSilk,0402
+Resistors_SMD:R_0805,0805
+TO_SOT_Packages_SMD:SOT-223,TO-261-4
+TO_SOT_Packages_SMD:SOT-23-6_Handsoldering,SOT-23-6
+TO_SOT_Packages_SMD:SOT-23,SOT-23
+Package_TO_SOT_SMD:SOT-23,SOT-23
+Bitraf:SOT-563,SOT-563
+
+Diode_SMD:D_SOD-323,SOD-323
+
+IPC7351-Nominal:CAPC1005X55,0402
+IPC7351-Nominal:CAPC1608X55,0603
+IPC7351-Nominal:CAPC2012X70,0805
+IPC7351-Nominal:CAPC3216X70,1206
+IPC7351-Nominal:CAPC3225X88,1210
+IPC7351-Nominal:CAPC4532X102,1812
+IPC7351-Nominal:CAPC4564X203,1825
+
+IPC7351-Nominal:LEDC1005X110,0402
+IPC7351-Nominal:LEDC1310X110,0504
+IPC7351-Nominal:LEDC1608X110,0603
+IPC7351-Nominal:LEDC2012X110,0805
+IPC7351-Nominal:LEDC3216X110,1206
+IPC7351-Nominal:LEDC3225X110,1210
+IPC7351-Nominal:LEDC4532X110,1812
+IPC7351-Nominal:LEDC4564X110,1825
+
+IPC7351-Nominal:RESC1005X38,0402
+IPC7351-Nominal:RESC1310X51,0504
+IPC7351-Nominal:RESC1608X63,0603
+IPC7351-Nominal:RESC2012X50,0805
+IPC7351-Nominal:RESC3216X60,1206
+IPC7351-Nominal:RESC3225X60,1210
+IPC7351-Nominal:RESC4532X70,1812
+IPC7351-Nominal:RESC4564X110,1825
diff --git a/test/doit/test_doit.py b/test/doit/test_doit.py
index 4076af8..8c98345 100644
--- a/test/doit/test_doit.py
+++ b/test/doit/test_doit.py
@@ -1,16 +1,18 @@
import inspect
-import logging
import os
import os.path
+import logging
+from pathlib import Path
+from ee.fact import DataSetManager
from inspect import Parameter
-
import ee.kicad.doit
-from ee.kicad.doit import task_kicad_sch_to_data_set, task_kicad_pcb_to_data_set, task_kicad_create_component_data_set
+
+from ee.kicad.doit import *
logger = logging.getLogger(__name__)
-file_dir = os.path.dirname(os.path.abspath(__file__))
-schematics_dir = os.path.join(file_dir, "schematics")
+file_dir = Path(__file__).parent
+schematics_dir = file_dir / "schematics"
def exec_task(task):
@@ -31,9 +33,16 @@ def exec_task(task):
# noinspection SpellCheckingInspection
def test_doit(tmpdir, caplog):
- ee.kicad.doit.init(sch=os.path.join(schematics_dir, "schematic-1.sch"),
- kicad_pcb=os.path.join(schematics_dir, "schematic-1.kicad_pcb"),
- data_set_dir=os.path.join(tmpdir, "ee"), )
+ dsm = DataSetManager(os.path.join(tmpdir, "ee"))
+
+ dsm.add_ds("csv", "kicad-footprint", "kicad-footprint-mapping",
+ path=schematics_dir / "ee" / "kicad-footprint.csv")
+
+ ee.kicad.doit.change_data_sets_for_task(task_kicad_create_component_data_set, lambda ds: ds + ["kicad-footprint"])
+
+ ee.kicad.doit.init(data_set_manager=dsm,
+ sch=schematics_dir / "schematic-1.sch",
+ kicad_pcb=schematics_dir / "schematic-1.kicad_pcb",)
exec_task(task_kicad_sch_to_data_set())
exec_task(task_kicad_pcb_to_data_set())