~ubuntu-branches/ubuntu/saucy/mago/saucy

« back to all changes in this revision

Viewing changes to gcalctool/gcalctool_options.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-02-08 13:32:13 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110208133213-m1og7ey0m990chg6
Tags: 0.3+bzr20-0ubuntu1
* debian/rules:
  - updated to debhelper 7
  - use dh_python2 instead of python-central
* debian/pycompat:
  - removed, no longer needed
* debian/control:
  - dropped cdbs and python-central dependencies
* bzr snapshot of the current trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
from mago.test_suite.gcalc import GCalctoolTestSuite
3
 
 
4
 
class GCalctoolOptions(GCalctoolTestSuite):
5
 
    def check_thousands(self, input, oracle, view='BASIC'):
6
 
        if self.application.get_view() != view:
7
 
            self.application.set_view(view)
8
 
        
9
 
        self.application.push(str(input))
10
 
        self.application.set_thousands_separator()
11
 
        value = self.application.get_value()
12
 
        if unicode(value) == unicode(oracle):
13
 
            pass
14
 
        else:
15
 
            raise AssertionError, "Expected %s, calculator returned %s" % (oracle, value)
16
 
 
17
 
    def cleanup(self):
18
 
        self.application.set_thousands_separator(False)
19
 
        GCalctoolTestSuite.cleanup(self)
20
 
 
21
 
    def teardown(self):
22
 
        self.application.set_thousands_separator(False)
23
 
        GCalctoolTestSuite.teardown(self)
24
 
 
25
 
 
26
 
if __name__ == "__main__":
27
 
    gcalctool_calculations_test = GCalctoolOptions()
28
 
    gcalctool_calculations_test.run()