aboutsummaryrefslogtreecommitdiff
path: root/test/test_kicad.py
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-12-12 12:02:29 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2017-12-15 07:30:35 +0100
commit102614dc8fe2f5aefd0fd92c1b6e48107a9629b0 (patch)
tree341436f8afc4a29819e59b199eb629a80ffd2df0 /test/test_kicad.py
parent6cd194703674268b313918b590f2bc483c641efa (diff)
downloadee-python-102614dc8fe2f5aefd0fd92c1b6e48107a9629b0.tar.gz
ee-python-102614dc8fe2f5aefd0fd92c1b6e48107a9629b0.tar.bz2
ee-python-102614dc8fe2f5aefd0fd92c1b6e48107a9629b0.tar.xz
ee-python-102614dc8fe2f5aefd0fd92c1b6e48107a9629b0.zip
o Adding a kicad-make-pos tool.
Diffstat (limited to 'test/test_kicad.py')
-rw-r--r--test/test_kicad.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_kicad.py b/test/test_kicad.py
new file mode 100644
index 0000000..3f78f54
--- /dev/null
+++ b/test/test_kicad.py
@@ -0,0 +1,18 @@
+import pytest
+from ee.kicad import parse_ref
+
+@pytest.mark.parametrize("ref,expected", [
+ ("C12", ("C", 12)),
+ ("C12?", None),
+ ("C?", ("C", None)),
+ ("junk", None),
+])
+def test_parse_ref(ref, expected):
+ if expected is None:
+ assert parse_ref(ref) is None
+ return
+
+ (expected_ref, expected_num) = expected
+ (actual_ref, actual_num) = parse_ref(ref)
+ assert expected_ref == actual_ref
+ assert expected_num == actual_num