File: test_application.py

package info (click to toggle)
gaphor 0.17.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,552 kB
  • ctags: 3,629
  • sloc: python: 23,713; xml: 222; makefile: 112; sh: 1
file content (32 lines) | stat: -rw-r--r-- 1,146 bytes parent folder | download | duplicates (2)
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
27
28
29
30
31
32
"""Application service test cases."""

import unittest

from zope import component

from gaphor import UML
from gaphor.application import Application
from gaphor.interfaces import IService

class LoadServiceTestCase(unittest.TestCase):

    """Test case for loading Gaphor services."""

    def test_service_load(self):
        """Test loading services and querying utilities."""
        
        Application.init(['undo_manager', 'file_manager', 'properties'])

        self.assertTrue(Application.get_service('undo_manager') is not None,\
                        'Failed to load the undo manager service')
                        
        self.assertTrue(Application.get_service('file_manager') is not None,\
                        'Failed to load the file manager service')

        self.assertTrue(component.queryUtility(IService, 'undo_manager') is not None,\
                        'Failed to query the undo manager utility')
                        
        self.assertTrue(component.queryUtility(IService, 'file_manager') is not None,\
                        'Failed to query the file manager utility')

        Application.shutdown()