File: test_Action.py

package info (click to toggle)
kiwi 1.9.22-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 11,912 kB
  • ctags: 5,549
  • sloc: python: 15,779; ansic: 193; xml: 77; makefile: 57; sh: 18
file content (26 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
from utils import refresh_gui
import unittest

from kiwi.ui.delegates import GladeDelegate

class ActionDelegate(GladeDelegate):
    def __init__(self):
        GladeDelegate.__init__(self, gladefile="actions.glade",
                               toplevel_name='window1',
                               delete_handler=self.quit_if_last)
        self.new_activated = False

    def on_New__activate(self, *args):
        self.new_activated = True

class ActionTest(unittest.TestCase):
    def testButtons(self):
        action_delegate = ActionDelegate()
        refresh_gui()
        action_delegate.New.activate()
        refresh_gui()
        self.assertEqual(action_delegate.new_activated, True)

if __name__ == '__main__':
    unittest.main()