Beispiel #1
0
	def test_isEmpty(self, test):
		emp = StateSet()
		if not emp.isEmpty():
			test.fail("Empty state found non-empty")
		emp.add(pyatspi.STATE_PRESSED)
		if emp.isEmpty():
			test.fail("State incorrectly found empty")
Beispiel #2
0
    def test_getStates(self, test):
        state = StateSet(*os)

        states = state.getStates()
        cone = set(states)
        ctwo = set(os)

        if not (cone.issubset(ctwo) and ctwo.issubset(cone)):
            test.fail("States not reported correctly")
Beispiel #3
0
	def test_getStates(self, test):
		state = StateSet(*os)

		states = state.getStates()
		cone = set(states)
		ctwo = set(os)

		if not (cone.issubset(ctwo) and ctwo.issubset(cone)):
			test.fail("States not reported correctly")
Beispiel #4
0
	def test_compare(self, test):
		one = StateSet(*os)
		two = StateSet(*os)

		onemtwo = one.compare(two)
		if not onemtwo.isEmpty():
			test.fail("Equal states when compared yeilds non-empty state")

		one.add(pyatspi.STATE_ACTIVE)
		onemtwo = one.compare(two)
		
		act = StateSet(pyatspi.STATE_ACTIVE)
		if not onemtwo.equals(act):
			test.fail("Compared states do not yeild correct state")
Beispiel #5
0
 def test_equals(self, test):
     one = StateSet(*os)
     two = StateSet(*os)
     if not one.equals(two):
         test.fail("Same states not found equal")
     two.remove(pyatspi.STATE_PRESSED)
     if two.equals(one):
         test.fail("Unequal states found equal")
Beispiel #6
0
    def test_compare(self, test):
        one = StateSet(*os)
        two = StateSet(*os)

        onemtwo = one.compare(two)
        if not onemtwo.isEmpty():
            test.fail("Equal states when compared yeilds non-empty state")

        one.add(pyatspi.STATE_ACTIVE)
        onemtwo = one.compare(two)

        act = StateSet(pyatspi.STATE_ACTIVE)
        if not onemtwo.equals(act):
            test.fail("Compared states do not yeild correct state")
Beispiel #7
0
 def test_isEmpty(self, test):
     emp = StateSet()
     if not emp.isEmpty():
         test.fail("Empty state found non-empty")
     emp.add(pyatspi.STATE_PRESSED)
     if emp.isEmpty():
         test.fail("State incorrectly found empty")
Beispiel #8
0
	def test_equals(self, test):
		one = StateSet(*os)
		two = StateSet(*os)
		if not one.equals(two):
			test.fail("Same states not found equal")
		two.remove(pyatspi.STATE_PRESSED)
		if two.equals(one):
			test.fail("Unequal states found equal")
Beispiel #9
0
 def getState(self):
     ss = StateSet()
     ss.add(STATE_SHOWING)
     return ss
	def test_getState(self, test):
		root = self._desktop.getChildAtIndex(0)
		state = root.getState()
		res = StateSet(*st)
		if not res.equals(state):
			test.fail("States not reported correctly")
Beispiel #11
0
 def test_remove(self, test):
     state = StateSet(*os)
     state.remove(pyatspi.STATE_PRESSED)
     if state.contains(pyatspi.STATE_PRESSED):
         test.fail("State not removed")
Beispiel #12
0
 def test_add(self, test):
     state = StateSet()
     state.add(pyatspi.STATE_PRESSED)
     if not state.contains(pyatspi.STATE_PRESSED):
         test.fail("State not added")
Beispiel #13
0
 def test_contains(self, test):
     state = StateSet(*os)
     if not state.contains(pyatspi.STATE_PRESSED):
         test.fail("Does not find contained state")
     if state.contains(pyatspi.STATE_ACTIVE):
         test.fail("Finds state not contained")
Beispiel #14
0
	def test_contains(self, test):
		state = StateSet(*os)
		if not state.contains(pyatspi.STATE_PRESSED):
			test.fail("Does not find contained state")
		if state.contains(pyatspi.STATE_ACTIVE):
			test.fail("Finds state not contained")
Beispiel #15
0
	def test_getState(self, test):
		root = self._root
		state = root.getState()
		res = StateSet(*st)
		if not res.equals(state):
			test.fail("States not reported correctly")
Beispiel #16
0
 def getState(self):
     return StateSet()
Beispiel #17
0
	def test_add(self, test):
		state = StateSet()
		state.add(pyatspi.STATE_PRESSED)
		if not state.contains(pyatspi.STATE_PRESSED):
			test.fail("State not added")
Beispiel #18
0
	def test_remove(self, test):
		state = StateSet(*os)
		state.remove(pyatspi.STATE_PRESSED)
		if state.contains(pyatspi.STATE_PRESSED):
			test.fail("State not removed")