Changeset 2264

Show
Ignore:
Timestamp:
03/06/08 11:54:12 (2 months ago)
Author:
arj..@yirdis.nl
Message:

fixed some unit tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/gaphor/UML/tests/test_elementfactory.py

    r2219 r2264  
    122122            events.append(event) 
    123123 
     124        #Application.init_components() 
    124125        Application.register_handler(handler) 
    125126 
  • gaphor/trunk/gaphor/diagram/states/transition.py

    r2254 r2264  
    4040        if not self.subject: 
    4141            return 
    42         element = event.element 
     42        element = event and event.element 
    4343        guard = self.subject.guard 
    4444        if event is None or \ 
  • gaphor/trunk/gaphor/diagram/tests/test_activitynodes.py

    r2046 r2264  
    44 
    55class ActivityNodesTestCase(TestCase): 
     6 
    67    def test_decision_node(self): 
    78        """Test creation of decision node 
  • gaphor/trunk/gaphor/storage/tests/test_storage.py

    r2150 r2264  
    1515from cStringIO import StringIO 
    1616 
    17 __module__ = 'test_storage' 
     17#__module__ = 'test_storage' 
    1818 
    1919class PseudoFile(object): 
  • gaphor/trunk/gaphor/ui/tests/test_diagramtoolbox.py

    r1301 r2264  
    11 
    22import gtk 
    3 import unittest 
    4  
     3from gaphor.tests.testcase import TestCase 
    54from gaphor.application import Application 
    65from gaphor.ui.diagramtab import DiagramTab 
     
    87from gaphor import UML 
    98 
    10 class DiagramToolboxTestCase(unittest.TestCase): 
     9class WindowOwner(object): 
     10    """ 
     11    Placeholder object for a MainWindow. Should provide just enough  
     12    methods to make the tests work. 
     13    """ 
     14 
     15    def remove_tab(self, other): 
     16        pass 
     17 
     18 
     19class DiagramToolboxTestCase(TestCase): 
     20 
     21    services = ['element_factory', 'properties'] 
    1122 
    1223    def setUp(self): 
    13         Application.init(services=['element_factory', 'properties']
    14         diagram = UML.Diagram() 
    15         tab = DiagramTab(None
     24        TestCase.setUp(self
     25        diagram = self.diagram 
     26        tab = DiagramTab(WindowOwner()
    1627        tab.diagram = diagram 
    1728        tab.construct() 
     
    1930 
    2031    def tearDown(self): 
    21         Application.shutdown(
     32        TestCase.tearDown(self
    2233 
    2334    def test_standalone_construct_with_diagram(self): 
     
    2940        # Ensure the factory is working 
    3041        self.tab.view.tool._factory() 
     42        self.diagram.canvas.update() 
    3143 
    3244    def test_placement_pointer(self):