| | 135 | |
|---|
| | 136 | def test_navigability_at_classifier(self): |
|---|
| | 137 | """Test association end navigability connected to any classifier""" |
|---|
| | 138 | c1 = self.create(UseCaseItem, UML.UseCase) |
|---|
| | 139 | c2 = self.create(UseCaseItem, UML.UseCase) |
|---|
| | 140 | |
|---|
| | 141 | a = self.create(AssociationItem) |
|---|
| | 142 | |
|---|
| | 143 | adapter = component.queryMultiAdapter((c1, a), IConnect) |
|---|
| | 144 | assert adapter |
|---|
| | 145 | adapter.connect(a.head) |
|---|
| | 146 | assert a.head.connected_to |
|---|
| | 147 | |
|---|
| | 148 | adapter = component.queryMultiAdapter((c2, a), IConnect) |
|---|
| | 149 | adapter.connect(a.tail) |
|---|
| | 150 | assert a.tail.connected_to |
|---|
| | 151 | |
|---|
| | 152 | head = a._head_end |
|---|
| | 153 | |
|---|
| | 154 | head._set_navigability(True) |
|---|
| | 155 | assert head.subject.classifier == c2.subject |
|---|
| | 156 | assert head.subject.owningAssociation is None |
|---|
| | 157 | |
|---|
| | 158 | head._set_navigability(False) |
|---|
| | 159 | assert head.subject.classifier is None |
|---|
| | 160 | assert head.subject.owningAssociation == a.subject |
|---|
| | 161 | |
|---|
| | 162 | head._set_navigability(None) |
|---|
| | 163 | assert head.subject.classifier is None |
|---|
| | 164 | assert head.subject.owningAssociation is None |
|---|
| | 165 | |
|---|