~nataliabidart/software-center/winged-migration

« back to all changes in this revision

Viewing changes to tests/gtk3/test_appmanager.py

  • Committer: Natalia B. Bidart
  • Date: 2012-05-30 18:39:55 UTC
  • mto: This revision was merged to the branch mainline in revision 3030.
  • Revision ID: natalia.bidart@canonical.com-20120530183955-zbnjczayktmmg5tv
- Initial test cleanup:
  - Renamed test/ dir to tests/.
  - Isolated test code into tests/ directory, including moving all the
    get_test_window_foo from the gtk3 production modules to
    tests/gtk3/windows.py module.
  - Removed all the calls to Gtk.main() in gtk3 tests since that blocks the
    execution of the suite.
  - Pep8 and pyflakes fixes in the files already modified in this branch.
  - Minor bug fix in the softwarecenter/log.py module when trying to create a
    log dir with proper perms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
 
1
import unittest
2
2
 
3
3
from mock import Mock
4
 
import unittest
5
4
 
6
 
from testutils import setup_test_env
 
5
from tests.utils import (
 
6
    do_events,
 
7
    get_test_db,
 
8
    get_test_gtk3_icon_cache,
 
9
    setup_test_env,
 
10
)
7
11
setup_test_env()
8
12
 
9
13
import softwarecenter.paths
10
14
from softwarecenter.db.application import Application
11
15
from softwarecenter.distro import get_distro
12
 
from softwarecenter.testutils import (
13
 
    get_test_db, get_test_gtk3_icon_cache, do_events)
14
16
from softwarecenter.ui.gtk3.session.appmanager import (
15
17
    ApplicationManager, get_appmanager)
16
18
 
 
19
 
17
20
class TestAppManager(unittest.TestCase):
18
21
    """ tests the appmanager  """
19
22
 
38
41
        # test creating it twice raises a error
39
42
        self.assertRaises(
40
43
            ValueError, ApplicationManager, self.db, self.backend, self.icons)
41
 
        
 
44
 
42
45
    def test_appmanager(self):
43
46
        app_manager = get_appmanager()
44
47
        self.assertNotEqual(app_manager, None)
74
77
        self._purchase_requested_signal = True
75
78
 
76
79
if __name__ == "__main__":
77
 
    import logging
78
 
    logging.basicConfig(level=logging.DEBUG)
79
80
    unittest.main()