Make the component library a standalone product door (2.63.0).

Add /api/library datasheet import and component GET/PUT with no exam.
Reorganize pytest into datasheet, library, schematic, PCB, and AF+AI.
Document Rust criteria (none chosen; no rustup) and coding conformity.
This commit is contained in:
2026-09-21 22:12:00 +02:00
parent 20733f0ec6
commit 4df04df5d4
101 changed files with 2060 additions and 302 deletions
+23
View File
@@ -0,0 +1,23 @@
from backend.services.digikey import _find_product
def test_find_product_accepts_underscore_vs_slash():
products = [{"ManufacturerProductNumber": "25AA1024-I/SM", "DatasheetUrl": "http://a.pdf"}]
picked = _find_product("25AA1024-I_SM", products)
assert picked is not None
assert picked["DatasheetUrl"] == "http://a.pdf"
def test_find_product_accepts_family_orderable():
products = [
{"ManufacturerProductNumber": "24AA025E64-I/SN", "DatasheetUrl": "http://b.pdf"},
]
picked = _find_product("24AA025E64", products)
assert picked is not None
assert picked["DatasheetUrl"] == "http://b.pdf"
def test_find_product_rejects_unrelated():
products = [{"ManufacturerProductNumber": "GRM21BR61A106KE19L", "DatasheetUrl": "http://c.pdf"}]
assert _find_product("10uF", products) is None
assert _find_product("CH340", [{"ManufacturerProductNumber": "CH340E"}]) is None