File: test_application.py

package info (click to toggle)
gaphor 0.13.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,692 kB
  • ctags: 2,971
  • sloc: python: 19,981; xml: 247; makefile: 54; sh: 40
file content (30 lines) | stat: -rw-r--r-- 892 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
"""
Application service test cases.
"""

import unittest

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


class LoadServiceTestCase(unittest.TestCase):
    def test_service_load(self):
        """
        Load services. At lease the undo_manager should be available after that.
        """
        Application.init(['undo_manager', 'file_manager', 'properties'])

        self.assertTrue(Application.get_service('undo_manager') is not None)
        self.assertTrue(Application.get_service('file_manager') is not None)

        # After that, services are also available as Utilities:
        self.assertTrue(component.queryUtility(IService, 'undo_manager') is not None)
        self.assertTrue(component.queryUtility(IService, 'file_manager') is not None)

        Application.shutdown()


# vim:sw=4:et:ai