7 from dbus.mainloop.glib import DBusGMainLoop
9 from accessible_cache import AccessibleCache
11 from xml.dom import minidom
14 def createNode(accessible, parentElement):
15 e = minidom.Element("accessible")
17 e.attributes["name"] = accessible.name
18 e.attributes["role"] = str(int(accessible.role))
19 e.attributes["description"] = accessible.description
21 for i in range(0, accessible.numChildren):
22 createNode(accessible.getChild(i), e)
24 parentElement.appendChild(e)
26 class AccessibleTestCase(coretest.CoreTestCase):
28 self._app = testutil.runTestApp("libobjectapp.so", self._name)
31 def post_application_test(self):
32 root = self._cache.getRootAccessible()
34 doc = minidom.Document()
36 answer = doc.toprettyxml()
38 correct = os.path.join(os.environ["TEST_DATA_DIRECTORY"],
39 "object-test-stage1-results.xml")
44 #print ''.join(difflib.unified_diff(answer.splitlines(), cstring.splitlines()))
46 self.assertEqual(answer, cstring, "Object tree not passed correctly")