Skip to content

Commit

Permalink
Add additional test for non-existing string path
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Nov 11, 2024
1 parent 7cb5ba1 commit c4c3bc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_urdf_parsing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pathlib

import pytest
import robot_descriptions
import robot_descriptions.loaders.idyntree
Expand Down Expand Up @@ -37,9 +39,12 @@ def test_urdf_parsing(robot: Robot) -> None:

# Check that it fails is is_urdf=True and the resource is a non-existing path
with pytest.raises(FileNotFoundError):
_ = rod.Sdf.load(sdf="/non/existing/path", is_urdf=None)
_ = rod.Sdf.load(sdf="/non/existing/path", is_urdf=False)

# Check that it fails is is_urdf=True and the resource is an empty string
with pytest.raises(FileNotFoundError):
_ = rod.Sdf.load(sdf=pathlib.Path("/non/existing/path"), is_urdf=False)

# The following instead should succeed
_ = rod.Sdf.load(sdf=urdf_path, is_urdf=None)
_ = rod.Sdf.load(sdf=urdf_path, is_urdf=True)
Expand Down

0 comments on commit c4c3bc8

Please sign in to comment.