File tree Expand file tree Collapse file tree 11 files changed +91
-118
lines changed Expand file tree Collapse file tree 11 files changed +91
-118
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ All notable changes to this project will be documented in this file.
8787
8888### Changed
8989
90+ - CICD: Isolate loader tests in testing submodules
9091- CICD: Update checkout actions to v4
9192- Update MuJoCo Menagerie repository commit
9293- Update eDO description repository
Original file line number Diff line number Diff line change 77from .test_clone_to_cache import TestCloneToCache
88from .test_clone_to_directory import TestCloneToDirectory
99from .test_descriptions import TestDescriptions
10- from .test_loaders import TestLoaders
1110from .test_progress_bar import TestProgressBar
1211
1312__all__ = [
1413 "TestCloneToCache" ,
1514 "TestCloneToDirectory" ,
1615 "TestDescriptions" ,
17- "TestLoaders" ,
1816 "TestProgressBar" ,
1917]
Original file line number Diff line number Diff line change 77import unittest
88
99from robot_descriptions ._descriptions import DESCRIPTIONS
10+ from robot_descriptions .loaders .idyntree import (
11+ load_robot_description as load_idyntree ,
12+ )
1013
11- from robot_descriptions .loaders .idyntree import load_robot_description
1214
1315class TestiDynTree (unittest .TestCase ):
14-
1516 """
1617 Check that all descriptions are loaded properly in iDynTree.
1718 """
1819
20+ def test_idyntree (self ):
21+ self .assertIsNotNone (
22+ load_idyntree (
23+ "upkie_description" ,
24+ commit = "98502d5b175c3d6b60b3cf475b7eeef9fd290c43" ,
25+ )
26+ )
27+
1928 @staticmethod
2029 def get_test_for_description (description : str ):
2130 """
@@ -29,10 +38,11 @@ def get_test_for_description(description: str):
2938 """
3039
3140 def test (self ):
32- load_robot_description (description )
41+ load_idyntree (description )
3342
3443 return test
3544
45+
3646# Add a test function for each URDF description
3747for name , description in DESCRIPTIONS .items ():
3848 if description .has_urdf :
Original file line number Diff line number Diff line change 77import unittest
88
99from robot_descriptions ._descriptions import DESCRIPTIONS
10- from robot_descriptions .loaders .mujoco import load_robot_description
10+ from robot_descriptions .loaders .mujoco import (
11+ load_robot_description as load_mujoco ,
12+ )
1113
1214
1315class TestMuJoCo (unittest .TestCase ):
14-
1516 """
1617 Check that all MJCF descriptions are loaded properly in MuJoCo.
1718 """
1819
20+ def test_mujoco (self ):
21+ self .assertIsNotNone (load_mujoco ("cassie_mj_description" ))
22+
1923 @staticmethod
2024 def get_test_for_description (description : str ):
2125 """
@@ -29,7 +33,7 @@ def get_test_for_description(description: str):
2933 """
3034
3135 def test (self ):
32- load_robot_description (description )
36+ load_mujoco (description )
3337
3438 return test
3539
Original file line number Diff line number Diff line change 77import unittest
88
99from robot_descriptions ._descriptions import DESCRIPTIONS
10- from robot_descriptions .loaders .pinocchio import load_robot_description
10+ from robot_descriptions .loaders .pinocchio import (
11+ load_robot_description as load_pinocchio ,
12+ )
1113
1214
1315class TestPinocchio (unittest .TestCase ):
1416 """
1517 Check that all descriptions are loaded properly in Pinocchio.
1618 """
1719
20+ def test_pinocchio (self ):
21+ self .assertIsNotNone (
22+ load_pinocchio (
23+ "upkie_description" ,
24+ commit = "98502d5b175c3d6b60b3cf475b7eeef9fd290c43" ,
25+ )
26+ )
27+
1828 @staticmethod
1929 def get_test_for_description (description : str ):
2030 """
@@ -28,7 +38,7 @@ def get_test_for_description(description: str):
2838 """
2939
3040 def test (self ):
31- load_robot_description (description )
41+ load_pinocchio (description )
3242
3343 return test
3444
Original file line number Diff line number Diff line change 99import pybullet
1010
1111from robot_descriptions ._descriptions import DESCRIPTIONS
12-
13- from robot_descriptions .loaders .pybullet import load_robot_description
12+ from robot_descriptions .loaders .pybullet import (
13+ load_robot_description as load_pybullet ,
14+ )
1415
1516
1617class TestPyBullet (unittest .TestCase ):
17-
1818 """
1919 Check that all descriptions are loaded properly in PyBullet.
2020 """
@@ -31,12 +31,22 @@ def tearDown(self):
3131 """
3232 pybullet .disconnect ()
3333
34+ def test_pybullet (self ):
35+ pybullet .connect (pybullet .DIRECT )
36+ self .assertIsNotNone (
37+ load_pybullet (
38+ "upkie_description" ,
39+ commit = "98502d5b175c3d6b60b3cf475b7eeef9fd290c43" ,
40+ )
41+ )
42+ pybullet .disconnect ()
43+
3444 def test_value_error_when_no_urdf (self ):
3545 """
3646 Test exception raised when a description has no URDF_PATH.
3747 """
3848 with self .assertRaises (ValueError ):
39- load_robot_description ("_empty_description" )
49+ load_pybullet ("_empty_description" )
4050
4151 @staticmethod
4252 def get_test_for_description (description : str ):
@@ -51,7 +61,7 @@ def get_test_for_description(description: str):
5161 """
5262
5363 def test (self ):
54- load_robot_description (description )
64+ load_pybullet (description )
5565
5666 return test
5767
Original file line number Diff line number Diff line change 77import unittest
88
99from robot_descriptions ._descriptions import DESCRIPTIONS
10- from robot_descriptions .loaders .robomeshcat import load_robot_description
10+ from robot_descriptions .loaders .robomeshcat import (
11+ load_robot_description as load_robomeshcat ,
12+ )
1113
1214
1315class TestRoboMeshCat (unittest .TestCase ):
14-
1516 """
1617 Check that all descriptions are loaded properly in RoboMeshCat.
1718 """
1819
20+ def test_robomeshcat (self ):
21+ self .assertIsNotNone (
22+ load_robomeshcat (
23+ "upkie_description" ,
24+ commit = "98502d5b175c3d6b60b3cf475b7eeef9fd290c43" ,
25+ )
26+ )
27+
1928 @staticmethod
2029 def get_test_for_description (description : str ):
2130 """
@@ -29,7 +38,7 @@ def get_test_for_description(description: str):
2938 """
3039
3140 def test (self ):
32- load_robot_description (description )
41+ load_robomeshcat (description )
3342
3443 return test
3544
Original file line number Diff line number Diff line change 77import unittest
88
99from robot_descriptions ._descriptions import DESCRIPTIONS
10- from robot_descriptions .loaders .yourdfpy import load_robot_description
10+ from robot_descriptions .loaders .yourdfpy import (
11+ load_robot_description as load_yourdfpy ,
12+ )
1113
1214
1315class TestYourdfpy (unittest .TestCase ):
14-
1516 """
1617 Check that all URDF descriptions are loaded properly in yourdfpy.
1718 """
1819
20+ def test_yourdfpy (self ):
21+ self .assertIsNotNone (
22+ load_yourdfpy (
23+ "upkie_description" ,
24+ commit = "98502d5b175c3d6b60b3cf475b7eeef9fd290c43" ,
25+ )
26+ )
27+
1928 @staticmethod
2029 def get_test_for_description (description : str ):
2130 """
@@ -29,7 +38,7 @@ def get_test_for_description(description: str):
2938 """
3039
3140 def test (self ):
32- load_robot_description (description )
41+ load_yourdfpy (description )
3342
3443 return test
3544
Original file line number Diff line number Diff line change 1212import git
1313
1414from robot_descriptions ._descriptions import DESCRIPTIONS
15+ from robot_descriptions .loaders .pinocchio import (
16+ load_robot_description as load_pinocchio ,
17+ )
1518
1619
1720class TestDescriptions (unittest .TestCase ):
@@ -46,6 +49,13 @@ def test_all_descriptions(self):
4649 f"in { description } " ,
4750 )
4851
52+ def test_cache_path_package_name (self ):
53+ """Check a description with package:// URIs and a custom commit ID."""
54+ load_pinocchio (
55+ "draco3_description" ,
56+ commit = "5afd19733d7b3e9f1135ba93e0aad90ed1a24cc7" ,
57+ )
58+
4959 def test_invalid_description_commit (self ):
5060 invalid_commit = "foobar"
5161 os .environ ["ROBOT_DESCRIPTION_COMMIT" ] = invalid_commit
@@ -55,3 +65,11 @@ def test_invalid_description_commit(self):
5565 if description_name in sys .modules :
5666 del sys .modules [description_name ]
5767 import_module (description_name )
68+
69+ def test_load_with_commit_then_without (self ):
70+ # https://github.com/robot-descriptions/robot_descriptions.py/issues/67
71+ load_pinocchio (
72+ "draco3_description" ,
73+ commit = "5afd19733d7b3e9f1135ba93e0aad90ed1a24cc7" ,
74+ )
75+ load_pinocchio ("baxter_description" )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments