Skip to content

Test/strengthen testcases#68

Merged
sadrasabouri merged 11 commits into
devfrom
test/strengthen_testcases
Aug 4, 2025
Merged

Test/strengthen testcases#68
sadrasabouri merged 11 commits into
devfrom
test/strengthen_testcases

Conversation

@AHReccese
Copy link
Copy Markdown
Member

@AHReccese AHReccese commented Aug 2, 2025

Reference Issues/PRs

In this PR, I strengthened the testcases checks by comparing before-after metadata in a rigid manner.

  • I found a bug in update function and fixed it.

What does this implement/fix? Explain your changes.

Any other comments?

@AHReccese AHReccese self-assigned this Aug 2, 2025
@AHReccese AHReccese requested a review from sadrasabouri August 2, 2025 23:14
@AHReccese AHReccese added bug Something isn't working enhancement New feature or request test labels Aug 2, 2025
@AHReccese AHReccese added this to the DMeta v0.5 milestone Aug 2, 2025
Copy link
Copy Markdown
Member

@sadrasabouri sadrasabouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! I left some comments.

Comment thread dmeta/functions.py Outdated
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}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do it on .keys() instead.

Comment thread dmeta/functions.py Outdated
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()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to merge them as one function to reduce redundancy (like an inner function inside the extract metadata function)

@AHReccese
Copy link
Copy Markdown
Member Author

Thank you Sadra for your feedback, I've applied both of them.
@sadrasabouri

@AHReccese AHReccese requested a review from sadrasabouri August 4, 2025 17:34
@sadrasabouri sadrasabouri merged commit 737f101 into dev Aug 4, 2025
21 checks passed
@sadrasabouri sadrasabouri deleted the test/strengthen_testcases branch August 4, 2025 18:23
@AHReccese AHReccese mentioned this pull request May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants