Skip to content

Commit

Permalink
Add Jameco and AutomationDirect tests, revert back to InvenTree stabl…
Browse files Browse the repository at this point in the history
…e, update InvenTree python API
  • Loading branch information
eeintech committed Jul 12, 2024
1 parent 9a738c5 commit 1651e5b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
git clone https://github.com/inventree/InvenTree/
mkdir InvenTree/static
cp tests/files/inventree_default_db.sqlite3 InvenTree/
cd InvenTree/ && git switch master && invoke install && invoke migrate && cd -
cd InvenTree/ && git switch stable && invoke install && invoke migrate && cd -
- name: Ki-nTree setup
run: |
invoke install
Expand Down
2 changes: 1 addition & 1 deletion kintree/common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,5 @@ def download_with_retry(url: str, full_path: str, silent=False, **kwargs) -> str
if not file:
return False

cprint('[INFO]\tSuccess: Part image downloaded', silent=silent)
cprint(f'[INFO]\tDownload success ({url=})', silent=silent)
return True
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ digikey-api = "^1.0.0"
# digikey-api = { git = "https://github.com/hurricaneJoef/digikey-api.git", branch = "master" }
flet = "^0.23.0"
thefuzz = "^0.19.0"
inventree = "^0.13.3"
inventree = "^0.14.0"
kiutils = "^1.4.0"
mouser = "^0.1.3"
multiprocess = "^0.70.12"
Expand Down
32 changes: 29 additions & 3 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
from kintree.config import config_interface
from kintree.database import inventree_api, inventree_interface
from kintree.kicad import kicad_interface
from kintree.search import digikey_api, mouser_api, element14_api, lcsc_api, tme_api
from kintree.search.snapeda_api import test_snapeda_api
from kintree.search import (
digikey_api,
mouser_api,
element14_api,
lcsc_api,
tme_api,
snapeda_api,
automationdirect_api,
jameco_api,
)
from kintree.setup_inventree import setup_inventree


Expand Down Expand Up @@ -129,9 +137,27 @@ def check_result(status: str, new_part: bool) -> bool:
else:
cprint('[ PASS ]')

# Test AutomationDirect API
if 'AutomationDirect' in settings.SUPPORTED_SUPPLIERS_API:
pretty_test_print('[MAIN]\tAutomationDirect API Test')
if not automationdirect_api.test_api():
cprint('[ FAIL ]')
sys.exit(-1)
else:
cprint('[ PASS ]')

# Test Jameco API
if 'Jameco' in settings.SUPPORTED_SUPPLIERS_API:
pretty_test_print('[MAIN]\tJameco API Test')
if not jameco_api.test_api():
cprint('[ FAIL ]')
sys.exit(-1)
else:
cprint('[ PASS ]')

# Test SnapEDA API methods
pretty_test_print('[MAIN]\tSnapEDA API Test')
if not test_snapeda_api():
if not snapeda_api.test_snapeda_api():
cprint('[ FAIL ]')
sys.exit(-1)
else:
Expand Down

0 comments on commit 1651e5b

Please sign in to comment.