| | 166 | |
|---|
| | 167 | def test_navigability_at_actor(self): |
|---|
| | 168 | """Test association end navigability connected to an actor""" |
|---|
| | 169 | c1 = self.create(ActorItem, UML.Actor) |
|---|
| | 170 | c2 = self.create(ActorItem, UML.Actor) |
|---|
| | 171 | |
|---|
| | 172 | a = self.create(AssociationItem) |
|---|
| | 173 | |
|---|
| | 174 | adapter = component.queryMultiAdapter((c1, a), IConnect) |
|---|
| | 175 | assert adapter |
|---|
| | 176 | adapter.connect(a.head) |
|---|
| | 177 | assert a.head.connected_to |
|---|
| | 178 | |
|---|
| | 179 | adapter = component.queryMultiAdapter((c2, a), IConnect) |
|---|
| | 180 | adapter.connect(a.tail) |
|---|
| | 181 | assert a.tail.connected_to |
|---|
| | 182 | |
|---|
| | 183 | head = a._head_end |
|---|
| | 184 | |
|---|
| | 185 | head.navigability = True |
|---|
| | 186 | assert head.subject.classifier == c2.subject |
|---|
| | 187 | assert head.subject.owningAssociation is None |
|---|
| | 188 | |
|---|
| | 189 | head.navigability = False |
|---|
| | 190 | assert head.subject.classifier is None |
|---|
| | 191 | assert head.subject.owningAssociation == a.subject |
|---|
| | 192 | |
|---|
| | 193 | head.navigability = None |
|---|
| | 194 | assert head.subject.classifier is None |
|---|
| | 195 | assert head.subject.owningAssociation is None |
|---|
| | 196 | |
|---|
| | 197 | |
|---|
| | 198 | |
|---|