X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fpyatspi%2Faccessibletest.py;h=6cd2cddf46c0974bf49569782d3894b15f34e867;hb=9eb5bf8c3ebea61c1b1907738bc6cc193839326c;hp=29d3aa2d56323a47bb555a7442583882e362634c;hpb=44f09457a5943064561849630015596a4d4528e6;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/tests/pyatspi/accessibletest.py b/tests/pyatspi/accessibletest.py index 29d3aa2..6cd2cdd 100644 --- a/tests/pyatspi/accessibletest.py +++ b/tests/pyatspi/accessibletest.py @@ -8,6 +8,13 @@ import os from pasytest import PasyTest as _PasyTest import pyatspi +from pyatspi import StateSet + +st = [pyatspi.STATE_MULTI_LINE, + pyatspi.STATE_MODAL, + pyatspi.STATE_INDETERMINATE, + pyatspi.STATE_SUPPORTS_AUTOCOMPLETION, + pyatspi.STATE_VERTICAL,] def _createNode(accessible, parentElement): e = minidom.Element("accessible") @@ -48,7 +55,8 @@ class AccessibleTest(_PasyTest): self._path = path def setup(self, test): - self._registry = pyatspi.registry.Registry(self._path) + self._registry = pyatspi.Registry() + print self._path self._desktop = self._registry.getDesktop(0) def test_name(self, test): @@ -100,8 +108,11 @@ class AccessibleTest(_PasyTest): def test_getAttributes(self, test): root = self._desktop.getChildAtIndex(0) - #TODO The AttributeSet test needs expanding. Check attributes are passed correctly. attr = root.getAttributes() + res = ["foo:bar", "baz:qux", "quux:corge"] + attr.sort() + res.sort() + test.assertEqual(attr, res, "Attributes expected %s, recieved %s" % (attr, res)) def test_parent(self, test): root = self._desktop.getChildAtIndex(0) @@ -141,7 +152,7 @@ class AccessibleTest(_PasyTest): def test_getRole(self, test): root = self._desktop.getChildAtIndex(0) test.assertEqual(root.getRole(), 69, - "Expected role - \"69\". Recieved - \"%d\"" % (root.getRole(),)) + "Expected role - \"69\". Recieved - \"%d\"" % (int(root.getRole()),)) def test_getRoleName(self, test): root = self._desktop.getChildAtIndex(0) @@ -159,10 +170,11 @@ class AccessibleTest(_PasyTest): "Expected roleName - \"%s\". Recieved - \"%s\"" % (ans, res,)) def test_getState(self, test): - # Complete test of StateSet interface is separate root = self._desktop.getChildAtIndex(0) state = root.getState() - list = state.getStates() + res = StateSet(*st) + if not res.equals(state): + test.fail("States not reported correctly") def test_childCount(self, test): root = self._desktop.getChildAtIndex(0)