diff --git a/python/mujoco/specs_test.py b/python/mujoco/specs_test.py index a4f1208bc2..1bf1436fcb 100644 --- a/python/mujoco/specs_test.py +++ b/python/mujoco/specs_test.py @@ -966,6 +966,7 @@ def test_attach_to_site(self): child1.assets = {'cube1.obj': 'cube1_content'} body1 = child1.worldbody.add_body() self.assertIs(body1, site.attach_body(body1, prefix='_')) + self.assertIsNotNone(child1.worldbody) body1.pos = [1, 1, 1] model1 = parent.compile() self.assertIsNotNone(model1) @@ -979,6 +980,7 @@ def test_attach_to_site(self): child2.assets = {'cube2.obj': 'cube2_content'} body2 = child2.worldbody.add_body(name='body') self.assertIsNotNone(parent.attach(child2, site=site, prefix='child2-')) + self.assertIsNone(child2.worldbody) body2.pos = [-1, -1, -1] model2 = parent.compile() self.assertIsNotNone(model2) @@ -995,6 +997,7 @@ def test_attach_to_site(self): child3.assets = {'cube3.obj': 'cube3_content'} body3 = child3.worldbody.add_body(name='body') self.assertIsNotNone(parent.attach(child3, site='site', prefix='child3-')) + self.assertIsNone(child3.worldbody) body3.pos = [-2, -2, -2] model3 = parent.compile() self.assertIsNotNone(model3) @@ -1032,6 +1035,7 @@ def test_attach_to_frame(self): child1.assets = {'cube1.obj': 'cube1_content'} body1 = child1.worldbody.add_body() self.assertIs(body1, frame.attach_body(body1, prefix='_')) + self.assertIsNotNone(child1.worldbody) body1.pos = [1, 1, 1] model1 = parent.compile() self.assertIsNotNone(model1) @@ -1045,6 +1049,7 @@ def test_attach_to_frame(self): child2.assets = {'cube2.obj': 'cube2_content'} body2 = child2.worldbody.add_body(name='body') self.assertIsNotNone(parent.attach(child2, frame=frame, prefix='child-')) + self.assertIsNone(child2.worldbody) body2.pos = [-1, -1, -1] model2 = parent.compile() self.assertIsNotNone(model2) @@ -1061,6 +1066,7 @@ def test_attach_to_frame(self): child3.assets = {'cube2.obj': 'new_cube2_content'} body3 = child3.worldbody.add_body(name='body') self.assertIsNotNone(parent.attach(child3, frame='frame', prefix='child3-')) + self.assertIsNone(child3.worldbody) body3.pos = [-2, -2, -2] model3 = parent.compile() self.assertIsNotNone(model3)