-
Notifications
You must be signed in to change notification settings - Fork 0
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
Empty elements are no longer removed when deserializing a BoM file #546
Conversation
@@ -80,33 +86,54 @@ def _compare_boms(*, source_bom: str, result_bom: str): | |||
output_lines.append(diff_item) | |||
return output_lines | |||
|
|||
def test_roundtrip_from_text_with_assertions(self): |
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.
The diff here is garbled. I basically duplicated the two existing tests, but passing in a path instead of a string
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #546 +/- ##
==========================================
+ Coverage 97.43% 97.63% +0.19%
==========================================
Files 18 18
Lines 2539 2542 +3
==========================================
+ Hits 2474 2482 +8
+ Misses 65 60 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Looks about right to me, no idea why I didnt make it trim empty elements in all cases... I had it in mind that somewhere we actually needed the other behaviour but I can't remember where or why
The new behavior is the converse, we keep empty elements in all cases, so as to be compliant with the schema. |
Closes #545
Standardizes the options used when deserializing a BoM from a file and from a string. Previously,
keep_empty=True
was only specified when reading a BoM from string, which caused a weird asymmetry in some situations.This PR removes this duplication, and adds some tests that check deserializing and round-tripping a BoM with an empty element works both via a file and via text.