Skip to content

Commit d73af27

Browse files
stephane-caronStéphane Caron
authored andcommitted
WIP: Move full loader tests to subfolder
1 parent 17b45d7 commit d73af27

File tree

7 files changed

+61
-0
lines changed

7 files changed

+61
-0
lines changed

tests/loaders/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Make sure Python treats the test directory as a package.

tests/test_loaders.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright 2022 Stéphane Caron
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
19+
import unittest
20+
import pybullet
21+
22+
from robot_descriptions.loaders.mujoco import (
23+
load_robot_description as load_mujoco,
24+
)
25+
from robot_descriptions.loaders.pinocchio import (
26+
load_robot_description as load_pinocchio,
27+
)
28+
from robot_descriptions.loaders.pybullet import (
29+
load_robot_description as load_pybullet,
30+
)
31+
from robot_descriptions.loaders.robomeshcat import (
32+
load_robot_description as load_robomeshcat,
33+
)
34+
from robot_descriptions.loaders.yourdfpy import (
35+
load_robot_description as load_yourdfpy,
36+
)
37+
38+
39+
class TestLoaders(unittest.TestCase):
40+
41+
"""
42+
Test loaders.
43+
"""
44+
45+
def test_mujoco(self):
46+
self.assertIsNotNone(load_mujoco("cassie_mj_description"))
47+
48+
def test_pinocchio(self):
49+
self.assertIsNotNone(load_pinocchio("upkie_description"))
50+
51+
def test_pybullet(self):
52+
pybullet.connect(pybullet.DIRECT)
53+
self.assertIsNotNone(load_pybullet("upkie_description"))
54+
pybullet.disconnect()
55+
56+
def test_robomeshcat(self):
57+
self.assertIsNotNone(load_robomeshcat("upkie_description"))
58+
59+
def test_yourdfpy(self):
60+
self.assertIsNotNone(load_yourdfpy("upkie_description"))

0 commit comments

Comments
 (0)