Skip to content

Commit 76d8f08

Browse files
author
Rachel
committed
Put tests in separate class
1 parent a4a4751 commit 76d8f08

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tests/test_util.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,14 @@ def test_SampleTimeGenerator_(self):
595595
decimal=7, err_msg=error, \
596596
verbose=True)
597597

598-
def test_GetPointFrom(self):
598+
class Test_GetPointFrom(unittest.TestCase):
599+
def setUp(self):
600+
self.env = openravepy.Environment()
601+
602+
def tearDown(self):
603+
self.env.Destroy()
604+
605+
def test_GetPointFrom_Kinbody(self):
599606
# Check that each input type returns the correct xyz coord
600607

601608
# Kinbody
@@ -604,21 +611,31 @@ def test_GetPointFrom(self):
604611
mug.SetTransform(numpy.eye(4))
605612
coord_kinbody = prpy.util.GetPointFrom(mug)
606613
expected_kinbody_coords = [0, 0, 0]
607-
#numpy.testing.assert_array_almost_equal(coord_kinbody, expected_kinbody_coords)
614+
numpy.testing.assert_array_almost_equal(coord_kinbody, expected_kinbody_coords)
608615

616+
def test_GetPointFrom_Space(self):
617+
# Check that each input type returns the correct xyz coord
609618
expected_coord = [1, 3, 4]
610619

611620
# Point in space
612621
space_coord = numpy.array([1, 3, 4])
613622
space_result = prpy.util.GetPointFrom(space_coord)
614623
numpy.testing.assert_array_almost_equal(space_result, expected_coord)
615624

625+
def test_GetPointFrom_Transform(self):
626+
# Check that each input type returns the correct xyz coord
627+
expected_coord = [1, 3, 4]
628+
616629
# 4x4 Transform
617630
trans_coord = numpy.eye(4)
618631
trans_coord[0:3, 3] = expected_coord
619632
trans_result = prpy.util.GetPointFrom(trans_coord)
620633
numpy.testing.assert_array_almost_equal(trans_result, expected_coord)
621634

635+
def test_GetPointFrom_List(self):
636+
# Check that each input type returns the correct xyz coord
637+
expected_coord = [1, 3, 4]
638+
622639
# List
623640
list_coord = [1, 3, 4]
624641
list_result = prpy.util.GetPointFrom(list_coord)

0 commit comments

Comments
 (0)