Changeset 2224
- Timestamp:
- 02/24/08 23:46:00 (3 months ago)
- Files:
-
- gaphor/trunk/gaphor/adapters/connectors.py (modified) (3 diffs)
- gaphor/trunk/gaphor/adapters/tests/test_connector.py (modified) (12 diffs)
- gaphor/trunk/gaphor/tests/testcase.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphor/trunk/gaphor/adapters/connectors.py
r2218 r2224 81 81 self.connect_constraints(handle) 82 82 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 83 88 # Set disconnect handler in the adapter, so it will also wotk if 84 89 # connections are created programmatically. … … 96 101 """ 97 102 self.disconnect_constraints(handle) 103 # TODO: AJM: is this correct? Should move to handle.disconnect()? 98 104 handle.connected_to = None 99 105 … … 200 206 """ 201 207 Base class for connecting two lines to each other. 202 The line that is con encted to is called 'element', as in ElementConnect.208 The line that is connected to is called 'element', as in ElementConnect. 203 209 204 210 Once a line has been connected at both ends, and a model element is gaphor/trunk/gaphor/adapters/tests/test_connector.py
r2086 r2224 30 30 31 31 assert handle.connected_to is comment 32 assert handle. _connect_constraintis not None32 assert handle.connection_data is not None 33 33 assert not comment.subject.annotatedElement 34 34 … … 39 39 40 40 assert handle.connected_to is None, handle.connected_to 41 assert not hasattr(handle,'_connect_constraint')41 #assert not hasattr(handle,'connection_constraint') 42 42 assert not comment.subject.annotatedElement, comment.subject.annotatedElement 43 43 … … 50 50 51 51 assert handle.connected_to is actor 52 assert handle. _connect_constraintis not None52 assert handle.connection_data is not None 53 53 assert len(comment.subject.annotatedElement) == 1, comment.subject.annotatedElement 54 54 assert actor.subject in comment.subject.annotatedElement, comment.subject.annotatedElement … … 62 62 63 63 assert handle.connected_to is actor2 64 assert handle. _connect_constraintis not None64 assert handle.connection_data is not None 65 65 assert len(comment.subject.annotatedElement) == 1, comment.subject.annotatedElement 66 66 assert actor2.subject in comment.subject.annotatedElement, comment.subject.annotatedElement … … 71 71 72 72 assert handle.connected_to is None, handle.connected_to 73 assert handle. _connect_constraintis None73 assert handle.connection_data is None 74 74 assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 75 75 assert not actor2.subject in comment.subject.annotatedElement, comment.subject.annotatedElement … … 118 118 119 119 assert handle.connected_to is assoc 120 assert handle. _connect_constraintis not None120 assert handle.connection_data is not None 121 121 assert not comment.subject.annotatedElement 122 122 … … 127 127 128 128 assert handle.connected_to is None 129 assert not hasattr(handle,'_connect_constraint')130 129 assert not comment.subject.annotatedElement, comment.subject.annotatedElement 131 130 … … 138 137 139 138 assert handle.connected_to is comment 140 assert handle. _connect_constraintis not None139 assert handle.connection_data is not None 141 140 assert len(comment.subject.annotatedElement) == 1, comment.subject.annotatedElement 142 141 assert assoc.subject in comment.subject.annotatedElement, comment.subject.annotatedElement … … 147 146 148 147 assert handle.connected_to is None, handle.connected_to 149 assert handle. _connect_constraintis None148 assert handle.connection_data is None 150 149 assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 151 150 assert not assoc.subject in comment.subject.annotatedElement, comment.subject.annotatedElement … … 178 177 179 178 assert handle.connected_to is comment 180 assert handle. _connect_constraintis not None179 assert handle.connection_data is not None 181 180 assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 182 181 … … 188 187 189 188 assert handle.connected_to is assoc 190 assert handle. _connect_constraintis not None189 assert handle.connection_data is not None 191 190 assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 192 191 assert assoc.subject is None … … 199 198 200 199 assert handle.connected_to is c1 201 assert handle. _connect_constraintis not None200 assert handle.connection_data is not None 202 201 assert len(comment.subject.annotatedElement) == 0, comment.subject.annotatedElement 203 202 assert assoc.subject is None gaphor/trunk/gaphor/tests/testcase.py
r2064 r2224 32 32 def tearDown(self): 33 33 Application.shutdown() 34 self.element_factory.flush()35 self.element_factory.shutdown()36 34 37 35
