|
Revision 2060, 0.9 kB
(checked in by wrobe..@pld-linux.org, 1 year ago)
|
- this test is about loading services so do not use basic TestCase?, which
loads element factory
|
| Line | |
|---|
| 1 |
""" |
|---|
| 2 |
Application service test cases. |
|---|
| 3 |
""" |
|---|
| 4 |
|
|---|
| 5 |
import unittest |
|---|
| 6 |
|
|---|
| 7 |
from gaphor import UML |
|---|
| 8 |
from gaphor.application import Application |
|---|
| 9 |
from zope import component |
|---|
| 10 |
from gaphor.interfaces import IService |
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
class LoadServiceTestCase(unittest.TestCase): |
|---|
| 14 |
def test_service_load(self): |
|---|
| 15 |
""" |
|---|
| 16 |
Load services. At lease the undo_manager should be available after that. |
|---|
| 17 |
""" |
|---|
| 18 |
Application.init(['undo_manager', 'file_manager']) |
|---|
| 19 |
|
|---|
| 20 |
self.assertTrue(Application.get_service('undo_manager') is not None) |
|---|
| 21 |
self.assertTrue(Application.get_service('file_manager') is not None) |
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
self.assertTrue(component.queryUtility(IService, 'undo_manager') is not None) |
|---|
| 25 |
self.assertTrue(component.queryUtility(IService, 'file_manager') is not None) |
|---|
| 26 |
|
|---|
| 27 |
Application.shutdown() |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|