-
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
Add 1st set of DspaceMets field methods #191
Conversation
Why these changes are being introduced: * Refactor DspaceMets to use field methods How this addresses that need: * Add create_dspace_mets_source_record_stub function to DspaceMets test module * Rename param xml > source_record * Add field methods and associated private methods for alternate_titles, citation, and content_type * Add unit tests for new field methods Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/TIMX-286
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.
Overall, looks great!
Left a comment about alternate list comprehension, and possible test, but nothing blocking. Really appreciating how these are clicking together, looking familiar.
* Refactor get_alternate_titles method for more efficient parsing * Add get_alternate_titles unit test for multiple titles
Pushed new commit responding to @ghukill 's suggestions! |
assert DspaceMets.get_alternate_titles(source_record) == [ | ||
timdex.AlternateTitle(value="Title 2"), | ||
timdex.AlternateTitle(value="Title 3"), | ||
] |
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.
This is awesome. Crystal clear the logic it's testing.
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.
@ehanson8 Great first pass! I focused on reviewing the main changes in dspace_mets.py
, and changes look good. I was curious what changes you made to the fixtures? It appears that a lot of the changes were directly to the XML files?
Just editing them to include |
Purpose and background context
Refactors the first set of
DspaceMets
fields as separate field methods. The absurd line count is from updating the METS fixtures and updating the imports fortest_datacite.py
to bring it in line with the other unit test modules in the repo. The actual code changes are ~250 lines.How can a reviewer manually see the effects of these changes?
Run the following command to see that the
DspaceMets
transform still transforms a source file:Includes new or updated dependencies?
NO
Changes expectations for external applications?
NO
What are the relevant tickets?
Developer
Code Reviewer(s)