diff --git a/tests/data/Digi-Key/dpn_1276-1131-1-ND_US_en_USD_US.dat b/tests/data/Digi-Key/dpn_1276-1131-1-ND_US_en_USD_US.dat new file mode 100644 index 00000000..598c6072 Binary files /dev/null and b/tests/data/Digi-Key/dpn_1276-1131-1-ND_US_en_USD_US.dat differ diff --git a/tests/data/Digi-Key/dpn_CR0603-JW-102ELFCT-ND_US_en_USD_US.dat b/tests/data/Digi-Key/dpn_CR0603-JW-102ELFCT-ND_US_en_USD_US.dat new file mode 100644 index 00000000..f237afa5 Binary files /dev/null and b/tests/data/Digi-Key/dpn_CR0603-JW-102ELFCT-ND_US_en_USD_US.dat differ diff --git a/tests/data/Mouser/mpn_CL10B102KC8NNNC.dat b/tests/data/Mouser/mpn_CL10B102KC8NNNC.dat new file mode 100644 index 00000000..728751a0 Binary files /dev/null and b/tests/data/Mouser/mpn_CL10B102KC8NNNC.dat differ diff --git a/tests/data/Mouser/mpn_CR0603-JW-102ELF.dat b/tests/data/Mouser/mpn_CR0603-JW-102ELF.dat new file mode 100644 index 00000000..0230e9a1 Binary files /dev/null and b/tests/data/Mouser/mpn_CR0603-JW-102ELF.dat differ diff --git a/tests/data/kicost_dk_mou_cache.yaml b/tests/data/kicost_dk_mou_cache.yaml new file mode 100644 index 00000000..17d2a383 --- /dev/null +++ b/tests/data/kicost_dk_mou_cache.yaml @@ -0,0 +1,71 @@ +# KiCost configuration file +kicost: + version: 1 + # Cache Time To Live in days, -1 is forever + # Default is 7 + cache_ttl: -1 + # Base directory for the APIs caches + # cache_path: ~/.cache/kicost + + +APIs: + Digi-Key: + # Digi-Key Client ID for a registered APP + client_id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + # Digi-Key Client Secret for a registered APP + client_secret: XXXXXXXXXXXXXXXX + # Use the sandbox server, doesn't count the usage, but returns old data + # sandbox: false + # Only enabled if the client_id and client_secret are defined + # enable: true + # Directory for the APIs caches + cache_path: ./Digi-Key + Mouser: + # Mouser Part API key + key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + # Only enabled if the key is defined + # enable: false + # Directory for the APIs caches + cache_path: ./Mouser + Element14: + # Element14 includes: Farnell, Newark and CPC + # Element14 Product Search API key + # key: XXXXXXXXXXXXXXXXXXXXXXXX + # Only enabled if the key is defined + # enable: false + # Country used for Farnell queries. + # Supported countries: BG,CZ,DK,AT,CH,DE,IE,IL,UK,ES,EE,FI,FR,HU,IT,LT, + # LV,BE,NL,NO,PL,PT,RO,RU,SK,SI,SE,TR,CN,AU,NZ,HK,SG,MY,PH,TH,IN,KR,VN + # farnell_country: UK + # Country used for Newark queries. + # Supported countries: US,CA,MX + # newark_country: US + # Country used for CPC queries. + # Supported countries: UK,IE + # cpc_country: UK + # Directory for the APIs caches + # cache_path: ~/.cache/kicost/Element14 + Octopart: + # Octopart API Key + # key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + # API level: 3 or 4 + # level: 4 + # The extended API is for the Pro plan + # extended: false + # Only enabled if the key is defined + # enable: false + # Directory for the APIs caches + # cache_path: ~/.cache/kicost/Octopart + TME: + # TME token (anonymous or private) + # token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + # TME application secret + # app_secret: XXXXXXXXXXXXXXXXXXXX + # Only enabled if the token and app_secret are defined + # enable: false + # Country where we are buying + # country: US + # Language for the texts + # language: EN + # Directory for the APIs caches + # cache_path: ~/.cache/kicost/TME diff --git a/tests/test_plot/test_kicost.py b/tests/test_plot/test_kicost.py index 2ad6b77d..2b499322 100644 --- a/tests/test_plot/test_kicost.py +++ b/tests/test_plot/test_kicost.py @@ -134,7 +134,7 @@ def test_kicost_spec_to_field_1(test_dir): ctx.run(kicost=True, extra_debug=True) output = prj+'-bom.xlsx' ctx.expect_out_file_d(output) - ctx.search_err([r'WARNING:\(.*\) C1 field `Tolerance` collision, has `20%`, found `.10%`', - r'WARNING:\(.*\) R1 field `Tolerance` collision, has `1%`, found `.5%`', - 'C1 RoHS: Compliant', 'R2 Tolerance: .5%']) + ctx.search_err([r'WARNING:\(.*\) C1 field `Tolerance` collision, has `20%`, found `10%`', + r'WARNING:\(.*\) R1 field `Tolerance` collision, has `1%`, found `5%`', + 'C1 RoHS: ROHS3 Compliant']) ctx.clean_up() diff --git a/tests/yaml_samples/spec_to_field_1.kibot.yaml b/tests/yaml_samples/spec_to_field_1.kibot.yaml index 8a34cd7e..54736b1a 100644 --- a/tests/yaml_samples/spec_to_field_1.kibot.yaml +++ b/tests/yaml_samples/spec_to_field_1.kibot.yaml @@ -7,11 +7,11 @@ filters: comment: 'Copy the RoHS status' from_output: 'bom_internal' specs: - - spec: rohs_status + - spec: rohs field: RoHS - - spec: [resistance_tolerance, capacitance_tolerance] + - spec: [resistance_tolerance, capacitance_tolerance, _tolerance] field: Tolerance - compare: smart + type: percent outputs: - name: create_sch @@ -46,4 +46,4 @@ outputs: xlsx: kicost: true specs: true - kicost_config: tests/data/kicost_default_config.yaml + kicost_config: tests/data/kicost_dk_mou_cache.yaml