Changeset 2224

Show
Ignore:
Timestamp:
02/24/08 23:46:00 (3 months ago)
Author:
arj..@yirdis.nl
Message:

fixed some connector unit tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/gaphor/adapters/connectors.py

    r2218 r2224  
    8181        self.connect_constraints(handle) 
    8282 
     83        # TODO: Add handler that triggers on setting self.element.subject = None 
     84        # TODO: How should we disconnect this handler? 
     85        #       Maybe one global handler will suffice. Then the adapters can 
     86        #       be created on an as-needed basis. 
     87         
    8388        # Set disconnect handler in the adapter, so it will also wotk if 
    8489        # connections are created programmatically. 
     
    96101        """ 
    97102        self.disconnect_constraints(handle) 
     103        # TODO: AJM: is this correct? Should move to handle.disconnect()? 
    98104        handle.connected_to = None 
    99105 
     
    200206    """ 
    201207    Base class for connecting two lines to each other. 
    202     The line that is conencted to is called 'element', as in ElementConnect. 
     208    The line that is connected to is called 'element', as in ElementConnect. 
    203209 
    204210    Once a line has been connected at both ends, and a model element is 
  • gaphor/trunk/gaphor/adapters/tests/test_connector.py

    r2086 r2224  
    3030 
    3131        assert handle.connected_to is comment 
    32         assert handle._connect_constraint is not None 
     32        assert handle.connection_data is not None 
    3333        assert not comment.subject.annotatedElement 
    3434 
     
    3939 
    4040        assert handle.connected_to is None, handle.connected_to 
    41         assert not hasattr(handle,'_connect_constraint') 
     41        #assert not hasattr(handle,'connection_constraint') 
    4242        assert not comment.subject.annotatedElement, comment.subject.annotatedElement 
    4343 
     
    5050 
    5151        assert handle.connected_to is actor 
    52         assert handle._connect_constraint is not None 
     52        assert handle.connection_data is not None 
    5353        assert len(comment.subject.annotatedElement) == 1, comment.subject.annotatedElement 
    5454        assert actor.subject in comment.subject.annotatedElement, comment.subject.annotatedElement 
     
    6262 
    6363        assert handle.connected_to is actor2 
    64         assert handle._connect_constraint is not None 
     64        assert handle.connection_data is not None 
    6565        assert len(comment.subject.annotatedElement) == 1, comment.subject.annotatedElement 
    6666        assert actor2.subject in comment.subject.annotatedElement, comment.subject.annotatedElement 
     
    7171 
    7272        assert handle.connected_to is None, handle.connected_to 
    73         assert handle._connect_constraint is None 
     73        assert handle.connection_data is None 
    7474        assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 
    7575        assert not actor2.subject in comment.subject.annotatedElement, comment.subject.annotatedElement 
     
    118118 
    119119        assert handle.connected_to is assoc 
    120         assert handle._connect_constraint is not None 
     120        assert handle.connection_data is not None 
    121121        assert not comment.subject.annotatedElement 
    122122 
     
    127127 
    128128        assert handle.connected_to is None 
    129         assert not hasattr(handle,'_connect_constraint') 
    130129        assert not comment.subject.annotatedElement, comment.subject.annotatedElement 
    131130 
     
    138137 
    139138        assert handle.connected_to is comment 
    140         assert handle._connect_constraint is not None 
     139        assert handle.connection_data is not None 
    141140        assert len(comment.subject.annotatedElement) == 1, comment.subject.annotatedElement 
    142141        assert assoc.subject in comment.subject.annotatedElement, comment.subject.annotatedElement 
     
    147146 
    148147        assert handle.connected_to is None, handle.connected_to 
    149         assert handle._connect_constraint is None 
     148        assert handle.connection_data is None 
    150149        assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 
    151150        assert not assoc.subject in comment.subject.annotatedElement, comment.subject.annotatedElement 
     
    178177 
    179178        assert handle.connected_to is comment 
    180         assert handle._connect_constraint is not None 
     179        assert handle.connection_data is not None 
    181180        assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 
    182181 
     
    188187 
    189188        assert handle.connected_to is assoc 
    190         assert handle._connect_constraint is not None 
     189        assert handle.connection_data is not None 
    191190        assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 
    192191        assert assoc.subject is None 
     
    199198 
    200199        assert handle.connected_to is c1 
    201         assert handle._connect_constraint is not None 
     200        assert handle.connection_data is not None 
    202201        assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 
    203202        assert assoc.subject is None 
  • gaphor/trunk/gaphor/tests/testcase.py

    r2064 r2224  
    3232    def tearDown(self): 
    3333        Application.shutdown() 
    34         self.element_factory.flush() 
    35         self.element_factory.shutdown() 
    3634         
    3735