1
# -*- coding: utf-8 -*-
2
from mago.test_suite.gcalc import GCalctoolViewTestSuite
4
class GCalctoolViews(GCalctoolViewTestSuite):
5
def changeViews(self, view, state, button):
6
value = self.application.get_value()
7
self.application.set_view(view)
8
if value != self.application.get_value():
9
raise AssertionError, "Displayed value changed upon changing views"
10
if state == "showing":
11
if self.application.showing(button) == False:
12
raise AssertionError, "Expected button is not showing"
13
elif state == "hidden":
14
if self.application.showing(button) == True:
15
raise AssertionError, "Button is not hidden as expected"
17
if __name__ == "__main__":
18
gcalctool_views_test = GCalctoolViews()
19
gcalctool_views_test.run()