5 from xml.dom import minidom
8 from pasytest import PasyTest as _PasyTest
12 def _createNode(accessible, parentElement):
13 e = minidom.Element("accessible")
15 e.attributes["name"] = accessible.name
16 e.attributes["role"] = str(int(accessible.getRole()))
17 e.attributes["description"] = accessible.description
19 for i in range(0, accessible.childCount):
20 _createNode(accessible.getChildAtIndex(i), e)
22 parentElement.appendChild(e)
24 class AccessibleTest(_PasyTest):
26 __tests__ = ["setup", "tree"]
28 def __init__(self, bus, path):
29 _PasyTest.__init__(self, "Accessible", False)
34 self._cache = pyatspi.TestApplicationCache(self._bus, self._path)
38 This is a mild stress test for the
48 It checks a tree of these values is correctly
49 passed from Application to AT.
51 root = self._cache.root
53 doc = minidom.Document()
54 _createNode(root, doc)
55 answer = doc.toprettyxml()
57 correct = os.path.join(os.environ["TEST_DATA_DIRECTORY"],
58 "object-test-stage1-results.xml")
62 self.assertEqual(answer, cstring, "Object tree not passed correctly")