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

« back to all changes in this revision

Viewing changes to tests/test_about.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
# Copyright (C) 2005-2010 Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
 
 
17
"""Minimal Test
 
18
 
 
19
This is a basic test to verify that mago-ng is working as expected and can
 
20
be run with various testing framework
 
21
 
 
22
To run it with:
 
23
$ mago-ng <path_to_this_file>
 
24
 
 
25
You can code ldtp directly in there or an external module
 
26
The only mandatory element is 'launcher' (and window_name for now)
 
27
 
 
28
set setupOnce to False to launch/close the app for each test
 
29
 
 
30
The purpose of this example is to test the management of the about
 
31
dialog
 
32
"""
 
33
 
 
34
from mago import TestCase
 
35
import unittest
 
36
import ldtp
 
37
 
 
38
class TestAbout(TestCase):
 
39
    """Test the about dialog
 
40
    """
 
41
    launcher = 'gucharmap'
 
42
    window_name = 'frmCharacterMap'
 
43
 
 
44
    def test_openclose(self):
 
45
        """Test opening and closing of the about dialog
 
46
 
 
47
        This test:
 
48
            - opens the about dialog
 
49
            - check the return code
 
50
            - check it the dialog is there
 
51
            - closes it
 
52
            - check the return code
 
53
            - check it the dialog vanished
 
54
        """
 
55
        # Open the about
 
56
        rc = self.application.about_open()
 
57
        self.assertTrue(rc)
 
58
        dlgAboutName = self.application.dlgAboutName
 
59
        self.assertIsNotNone(dlgAboutName,
 
60
                             "Name of the about dialog was not found")
 
61
        self.assertTrue(ldtp.guiexist(dlgAboutName))
 
62
 
 
63
        # Then close it
 
64
        rc = self.application.about_close()
 
65
        self.assertTrue(rc)
 
66
        self.assertFalse(ldtp.guiexist(dlgAboutName))
 
67
 
 
68
 
 
69
if __name__ == "__main__":
 
70
    unittest.main()