MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / testDetach

Method testDetach

dm_control/mjcf/element_test.py:450–467  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

448 self.assertEqual(default_xml_lines[-1], '</default>')
449
450 def testDetach(self):
451 root = parser.from_path(_TEST_MODEL_XML)
452 root.model = 'model'
453
454 submodel = copy.copy(root)
455 submodel.model = 'submodel'
456
457 unattached_xml_1 = root.to_xml_string()
458 root.attach(submodel)
459 attached_xml_1 = root.to_xml_string()
460
461 submodel.detach()
462 unattached_xml_2 = root.to_xml_string()
463 root.attach(submodel)
464 attached_xml_2 = root.to_xml_string()
465
466 self.assertEqual(unattached_xml_1, unattached_xml_2)
467 self.assertEqual(attached_xml_1, attached_xml_2)
468
469 def testRenameAttachedModel(self):
470 root = parser.from_path(_TEST_MODEL_XML)

Callers

nothing calls this directly

Calls 5

assertEqualMethod · 0.80
copyMethod · 0.45
to_xml_stringMethod · 0.45
attachMethod · 0.45
detachMethod · 0.45

Tested by

no test coverage detected