Skip to content

Commit

Permalink
Add pytest basic tests and fix import to be coherent with README (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Sep 1, 2023
1 parent 947d31d commit 4647fbb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
- name: Import the package
shell: bash -l {0}
run: python -c "import resolve_robotics_uri_py"

- name: Run the Python tests
shell: bash -l {0}
run: pytest

# This test requires the conda-forge::icub-models,
# robotology::ergocub-software and
Expand Down
1 change: 1 addition & 0 deletions ci_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ channels:
dependencies:
- python
- pip
- pytest
# packages that ship URDFs used to test
- icub-models
- ergocub-software
Expand Down
1 change: 1 addition & 0 deletions src/resolve_robotics_uri_py/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .resolve_robotics_uri_py import resolve_robotics_uri
6 changes: 6 additions & 0 deletions test/test_resolve_robotics_uri_py.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import resolve_robotics_uri_py
import pytest

def test_non_existing_file():
with pytest.raises(FileNotFoundError):
resolve_robotics_uri_py.resolve_robotics_uri("package://this/package/and/file/does/not.exist")

0 comments on commit 4647fbb

Please sign in to comment.