~ubuntu-branches/ubuntu/utopic/dogtail/utopic

« back to all changes in this revision

Viewing changes to examples/gcalctool-test-fibonacci.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-12-21 13:33:47 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20061221133347-xo9jg11afp5plcka
Tags: upstream-0.6.1
ImportĀ upstreamĀ versionĀ 0.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
# Use GCalcTool to calculate the Fibonacci series (and check the results)
3
 
 
4
 
import dogtail.tree
5
 
from dogtail.apps.wrappers.gcalctool import *
6
 
import dogtail.utils
7
 
 
8
 
dogtail.utils.run('gcalctool')
9
 
gcalctool = GCalcTool(dogtail.tree.root.application('gcalctool'))
10
 
 
11
 
import dogtail.config
12
 
dogtail.config.config.defaultDelay = 0.3
13
 
 
14
 
a = 1
15
 
b = 1
16
 
        
17
 
while True:
18
 
        gcalctool.clearEntry()
19
 
        gcalctool.typeNumber(a, 10)
20
 
        gcalctool.button('Add').click()
21
 
        gcalctool.typeNumber(b, 10)
22
 
        
23
 
        gcalctool.button('Calculate result').click()
24
 
        
25
 
        assert int(gcalctool.getText())==(a+b)
26
 
        
27
 
        a=b
28
 
        b=int(gcalctool.getText())
29
 
 
30