-
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
Refactor BagReader
as BagAdapter
#21
base: store-resource
Are you sure you want to change the base?
Conversation
…gAdapter.validate(); move FakeBagAdapter to bag_adapter
is_valid = False | ||
print(e) | ||
|
||
raise ValidationError(f"Validation failed with the following message: \"{str(e)}\"") |
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.
str()
might not be needed here, but I do want to call bagit-python
's __str__
method which captures all the error details in a single string. So being extra explicit I guess?
uow.add_event(PackageNotVerified( | ||
package_identifier=event.package_identifier, | ||
tracking_identifier=event.tracking_identifier, | ||
message=e.message | ||
)) |
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 thought about adding an end-to-end test for this, but wasn't sure if I should do that on my own, or if we should wait until we have a handler for that event and some kind of notification component (email)?
To Do
is_valid
with exception-raisingvalidate
tests/fixtures/test_bags
BagReader
toBagAdapter
and update step file and handlersPackageNotVerified
event