New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue where copy/paste + delete of original association causes association ends to be removed #411
Conversation
d35af69
to
c185786
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look great, nice simplifications as well and moves us a step closer to full pytest. I just had a nitpick about spelling and a question.
assert aa.subject.memberEnd[0].type is c.subject | ||
assert aa.subject.memberEnd[1].type is c.subject | ||
assert aa.subject.memberEnd[0] is aa.head_end.subject | ||
assert aa.subject.memberEnd[1] is aa.tail_end.subject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure this is my misunderstanding, if the original a
is deleted, I would think that the copy of a called aa
is also deleted. Why would these assert statements pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a
is an AssociationItem
, aa
is also an AssociationItem
. Both point to the same association (the subject
). If I remove one, the model should not change, since there's still a presentation of the Association
model element in a diagram.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation 👍
Sourcery Code Quality Report (beta)✅ Merging this PR will increase code quality in the affected files by 0.03 out of 10.
Here are some functions in these files that still need a tune-up:
Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Let us know what you think of it by mentioning @sourcery-ai in a comment. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Create a class, connect both ends of an association to it. Copy + paste the association and remove the original.
See
tests/test_multiple_associations.py
for a failing scenario.What is the new behavior?
I hope it will work as expected: association ends remain in tact as well as the navigability.
Does this PR introduce a breaking change?
Notes
This is also applicable for Connectors!
Scenario's I can think of:
What's the behavior we're looking for?