From 9d0812911c7ba3631fb3fba6ca1a24598b788ab4 Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Fri, 5 Jul 2024 06:15:40 -0700 Subject: [PATCH] Add a test for type attribute. PiperOrigin-RevId: 649635359 Change-Id: Ibe5d9fcb5f14371e5f154d645b838a9d012331d5 --- python/mujoco/specs_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/mujoco/specs_test.py b/python/mujoco/specs_test.py index 9c36d728..aae10380 100644 --- a/python/mujoco/specs_test.py +++ b/python/mujoco/specs_test.py @@ -62,8 +62,10 @@ class SpecsTest(absltest.TestCase): # Add a site to the body with user data and read it back. site = body.add_site() site.name = 'sitename' + site.type = mujoco.mjtGeom.mjGEOM_BOX site.userdata = [1, 2, 3, 4, 5, 6] self.assertEqual(site.name, 'sitename') + self.assertEqual(site.type, mujoco.mjtGeom.mjGEOM_BOX) np.testing.assert_array_equal(site.userdata, [1, 2, 3, 4, 5, 6]) # Check that the site and body have no id before compilation. @@ -90,7 +92,7 @@ class SpecsTest(absltest.TestCase): - + @@ -232,6 +234,5 @@ class SpecsTest(absltest.TestCase): self.assertEqual(spec.sensors[1].name, 'sensor2') self.assertEqual(spec.sensors[2].name, 'sensor3') - if __name__ == '__main__': absltest.main()