~ubuntu-branches/ubuntu/lucid/exaile/lucid

« back to all changes in this revision

Viewing changes to tools/guitest/tests/test_Tkintertest.py

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2010-02-12 19:51:01 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100212195101-8jt3tculxcl92e6v
Tags: 0.3.1~b1-0ubuntu1
* New upstream release.
* Adjust exaile.install for new plugins.
* debian/control:
 - Drop unneeded python-dev Build-Dep.
 - Bump Standards-Version to 3.8.4 
* debian/rules: No empty po files to delete.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""Tests for the fake_Tkinter module."""
2
 
 
3
 
import unittest
4
 
import doctest
5
 
 
6
 
from guitest.Tkintertest import TkinterTestHelperMixin, TkinterTestCase
7
 
from guitest.Tkintertest import guistate, setUp, tearDown
8
 
 
9
 
import Tkinter
10
 
 
11
 
 
12
 
def test_mainloop():
13
 
    """Test for global Tkinter functions.
14
 
 
15
 
    The functions dealing with the main loop are important yet very simple.
16
 
 
17
 
        >>> def fake_main():
18
 
        ...     print 'Running main, level:', guistate.level
19
 
        >>> guistate.main = fake_main
20
 
        >>> Tkinter.mainloop()
21
 
        Running main, level: 1
22
 
 
23
 
        >>> guistate.level
24
 
        1
25
 
 
26
 
    """
27
 
 
28
 
 
29
 
def test_TkinterTestHelperMixin():
30
 
    """Tests for TkinterTestHelperMixin.
31
 
 
32
 
        >>> from guitest.utils import GuiTestHelperMixin
33
 
        >>> issubclass(TkinterTestHelperMixin, GuiTestHelperMixin)
34
 
        True
35
 
        >>> TkinterTestHelperMixin.toolkit_overrides
36
 
        {...}
37
 
 
38
 
    """
39
 
 
40
 
 
41
 
def test_TkinterTestCase():
42
 
    """Tests for TkinterTestCase.
43
 
 
44
 
        >>> issubclass(TkinterTestCase, TkinterTestHelperMixin)
45
 
        True
46
 
        >>> issubclass(TkinterTestCase, unittest.TestCase)
47
 
        True
48
 
 
49
 
    """
50
 
 
51
 
 
52
 
def test_doctest_support():
53
 
    """Tests for doctest support.
54
 
 
55
 
        >>> from guitest.Tkintertest import setUp, setUp_param, tearDown
56
 
 
57
 
    We only have a quick glance at the functions because they are already
58
 
    being used in this docsuite and everything would break if they did not
59
 
    work.
60
 
 
61
 
        >>> setUp
62
 
        <bound method DoctestHelper.setUp of \
63
 
<guitest.utils.DoctestHelper object at ...>>
64
 
 
65
 
        >>> setUp_param
66
 
        <bound method DoctestHelper.setUp_param of \
67
 
<guitest.utils.DoctestHelper object at ...>>
68
 
 
69
 
        >>> tearDown
70
 
        <bound method DoctestHelper.tearDown of \
71
 
<guitest.utils.DoctestHelper object at ...>>
72
 
 
73
 
    """
74
 
 
75
 
 
76
 
def test_suite():
77
 
    return doctest.DocTestSuite(setUp=setUp, tearDown=tearDown,
78
 
                                optionflags=doctest.ELLIPSIS)
79
 
 
80
 
 
81
 
if __name__ == '__main__':
82
 
    unittest.main(defaultTest='test_suite')