fixed some tests

git-svn-id: file:///Users/arjan/backup/gaphor/gaphor/trunk@2712 a8418922-720d-0410-834f-a69b97ada669
This commit is contained in:
Arjan Molenaar 2009-02-11 21:12:59 +00:00
parent 739e1cf071
commit 88106faa99
8 changed files with 13 additions and 8 deletions

View File

@ -48,7 +48,6 @@ override Class.extension
def class_extension(self):
extension = []
for e in self._factory.select(lambda e: e.isKindOf(Extension) and self in e.endType):
extension.append(e)
return extension

View File

@ -2,6 +2,8 @@
Unnit tests for AssociationItem.
"""
from zope import component
from gaphor.diagram.interfaces import IConnect
from gaphor.tests import TestCase
from gaphor import UML
from gaphor.diagram.items import AssociationItem, ClassItem, InterfaceItem, \

View File

@ -9,7 +9,7 @@ from gaphor.application import Application
class DiagramLayoutTestCase(unittest.TestCase):
def setUp(self):
Application.init(services=['element_factory', 'gui_manager', 'properties', 'action_manager', 'diagram_layout'])
Application.init(services=['element_factory', 'gui_manager', 'properties', 'action_manager', 'diagram_layout', 'property_based_dispatcher'])
def tearDown(self):
Application.shutdown()

View File

@ -21,10 +21,11 @@ log.set_log_level(log.WARNING)
class TestCase(unittest.TestCase):
core_services = ['property_based_dispatcher']
services = ['element_factory', 'adapter_loader']
def setUp(self):
Application.init(services=self.services)
Application.init(services=self.core_services+self.services)
self.element_factory = Application.get_service('element_factory')
assert len(list(self.element_factory.select())) == 0, list(self.element_factory.select())
self.diagram = self.element_factory.create(UML.Diagram)
@ -32,6 +33,7 @@ class TestCase(unittest.TestCase):
def tearDown(self):
self.element_factory.shutdown()
Application.shutdown()

View File

@ -10,7 +10,7 @@ from gaphor.ui.mainwindow import MainWindow
class DiagramTabTestCase(unittest.TestCase):
def setUp(self):
Application.init(services=['element_factory', 'gui_manager', 'action_manager', 'properties'])
Application.init(services=['element_factory', 'gui_manager', 'action_manager', 'properties', 'property_based_dispatcher'])
main_window = Application.get_service('gui_manager').main_window
element_factory = Application.get_service('element_factory')
self.element_factory = element_factory

View File

@ -23,7 +23,7 @@ class HandleToolTestCase(unittest.TestCase):
"""
def setUp(self):
Application.init(services=['adapter_loader', 'element_factory', 'gui_manager', 'properties_manager', 'action_manager', 'properties'])
Application.init(services=['adapter_loader', 'element_factory', 'gui_manager', 'properties_manager', 'action_manager', 'properties', 'property_based_dispatcher'])
self.main_window = Application.get_service('gui_manager').main_window
def shutDown(self):

View File

@ -18,7 +18,7 @@ from gaphor.application import Application
class AssociationUndoTestCase(unittest.TestCase):
def setUp(self):
Application.init(services=['adapter_loader', 'element_factory', 'undo_manager'])
Application.init(services=['adapter_loader', 'element_factory', 'undo_manager', 'property_based_dispatcher'])
def tearDown(self):
Application.shutdown()

View File

@ -1,6 +1,6 @@
# vim:sw=4:et:ai
import unittest
from gaphor.tests import TestCase
from weakref import ref as wref
from sys import getrefcount
from gaphor import UML
@ -13,7 +13,9 @@ factory = UML.ElementFactory()
factory.init(Application)
class TestDiagramItems(unittest.TestCase):
class TestDiagramItems(TestCase):
services = ['element_factory', 'property_based_dispatcher']
def gc_collect(self):
import gc