~gary-lasker/software-center/fix-dbus-crash-reinstall-prev-lp863898

« back to all changes in this revision

Viewing changes to test/gtk3/test_dialogs.py

  • Committer: Michael Vogt
  • Date: 2011-10-11 11:58:07 UTC
  • mfrom: (2434.2.9 bigdia)
  • Revision ID: michael.vogt@ubuntu.com-20111011115807-vkkqvmpvzqc57db1
* lp:~mmcg069/software-center/dialog-improvements:
  - improve the widget packing of the submit_review dialog
  - make the dialog-dep-warning dialog neither closable or maximisable
    as per bug LP: #844025
  - make dialog-dependency-alert dialog use a gtkgrid instead of 
    gtktable to fix overly big spacing
* test/gtk3/test_dialogs.py:
  - add basic test for dependency dialogs
* softwarecenter/ui/gtk3/dialogs/dependency_dialogs.py:
  - simplfy test setup code

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
from gi.repository import Gtk, GdkPixbuf, GObject
 
4
import os
 
5
import sys
 
6
import unittest
 
7
 
 
8
from mock import Mock
 
9
 
 
10
sys.path.insert(0,"..")
 
11
 
 
12
# ensure datadir is pointing to the right place
 
13
import softwarecenter.paths
 
14
softwarecenter.paths.datadir = os.path.join(
 
15
    os.path.dirname(__file__), "..", "..", 'data')
 
16
 
 
17
# window destory timeout
 
18
TIMEOUT=100
 
19
 
 
20
class TestDialogs(unittest.TestCase):
 
21
    """ basic tests for the various gtk3 dialogs """
 
22
 
 
23
    def test_dependency_dialogs(self):
 
24
        from softwarecenter.ui.gtk3.dialogs.dependency_dialogs import get_test_dialog
 
25
        dia = get_test_dialog()
 
26
        GObject.timeout_add(TIMEOUT, 
 
27
                            lambda: dia.response(Gtk.ResponseType.ACCEPT))
 
28
        dia.run()
 
29
        
 
30
 
 
31
if __name__ == "__main__":
 
32
    import logging
 
33
    logging.basicConfig(level=logging.DEBUG)
 
34
    unittest.main()