-
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
DAG for processing preceding/succeeding titles #140
Conversation
plugins/folio/helpers.py
Outdated
@@ -286,6 +321,8 @@ def post_to_okapi(**kwargs) -> bool: | |||
logger.error(new_record_result.text) | |||
_save_error_record_ids(error_code=new_record_result.status_code, **kwargs) | |||
|
|||
return new_record_result.json |
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.
For the test to pass I had to change this from new_record_result.json()
so I am wondering if this is the right thing to return or not?
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.
Hmm, this returns the method signature and not the JSON dictionary. I'm seeing some test failures like
def __getattr__(self, name):
if name in {'_mock_methods', '_mock_unsafe'}:
raise AttributeError(name)
elif self._mock_methods is not None:
if name not in self._mock_methods or name in _all_magics:
> raise AttributeError("Mock object has no attribute %r" % name)
E AttributeError: Mock object has no attribute 'json'
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/unittest/mock.py:634: AttributeError
Is this similar to what you're seeing?
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 was seeing TypeError: 'dict' object is not callable
but using the lambda function as you suggested fixed it.
Fixes sul-dlss/FOLIO-Project-Stanford#142