Skip to content

Commit ec43d54

Browse files
committed
TESTS: Adding tests for robot as well as examine envs
1 parent c7b20e3 commit ec43d54

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

robohive/tests/test_all.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from robohive.tests.test_claws import TestClaws
88
from robohive.tests.test_tcdm import TestTCDM
99

10+
from robohive.tests.test_examine_env import TestExamineEnv
11+
from robohive.tests.test_robot import TestRobot
1012

1113
if __name__ == '__main__':
1214
unittest.main()

robohive/tests/test_examine_env.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import click.testing
33
import unittest
44
from robohive.utils.examine_env import main as examine_env
5-
class TestMain(unittest.TestCase):
5+
6+
7+
class TestExamineEnv(unittest.TestCase):
68
def test_main(self):
79
# Call your function and test its output/assertions
810
print("Testing env with random policy")
@@ -21,5 +23,9 @@ def test_offscreen_rendering(self):
2123
"--num_episodes", 1, \
2224
"--render", "offscreen",\
2325
"--camera_name", "top_acam"])
24-
# print(result.output.strip())
25-
self.assertEqual(result.exception, None)
26+
print(result.output.strip())
27+
self.assertEqual(result.exception, None)
28+
29+
30+
if __name__ == '__main__':
31+
unittest.main()

robohive/tests/test_robot.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import unittest
2+
from robohive.robot.robot import demo_robot
3+
4+
class TestRobot(unittest.TestCase):
5+
def test_robot(self):
6+
# Call your function and test its output/assertions
7+
print("Testing robot")
8+
demo_robot()
9+
10+
if __name__ == '__main__':
11+
unittest.main()

0 commit comments

Comments
 (0)