Test/strengthen testcases#68
Merged
Merged
Conversation
sadrasabouri
requested changes
Aug 3, 2025
Member
sadrasabouri
left a comment
There was a problem hiding this comment.
Good job! I left some comments.
Comment on lines
+144
to
+145
| personal_fields_core_xml = {e: config[e] for e, _ in CORE_XML_MAP.items() if e in config} | ||
| personal_fields_app_xml = {e: config[e] for e, _ in APP_XML_MAP.items() if e in config} |
Member
There was a problem hiding this comment.
You can do it on .keys() instead.
Comment on lines
+260
to
+276
| # Extract metadata from core.xml | ||
| if os.path.exists(core_xml_path): | ||
| tree = lxml.parse(core_xml_path) | ||
| for xml_element in tree.iter(): | ||
| for personal_field, xml_tag in CORE_XML_MAP.items(): | ||
| if xml_tag in xml_element.tag: | ||
| value = xml_element.text if xml_element.text else "" | ||
| extracted_metadata[personal_field] = value.strip() | ||
|
|
||
| # Extract metadata from app.xml | ||
| if os.path.exists(app_xml_path): | ||
| tree = lxml.parse(app_xml_path) | ||
| for xml_element in tree.iter(): | ||
| for personal_field, xml_tag in APP_XML_MAP.items(): | ||
| if xml_tag in xml_element.tag: | ||
| value = xml_element.text if xml_element.text else "" | ||
| extracted_metadata[personal_field] = value.strip() |
Member
There was a problem hiding this comment.
I think it's better to merge them as one function to reduce redundancy (like an inner function inside the extract metadata function)
Member
Author
|
Thank you Sadra for your feedback, I've applied both of them. |
sadrasabouri
approved these changes
Aug 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
In this PR, I strengthened the testcases checks by comparing before-after metadata in a rigid manner.
updatefunction and fixed it.What does this implement/fix? Explain your changes.
Any other comments?