-
Notifications
You must be signed in to change notification settings - Fork 7
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 some helper methods to load and save config settings #1472
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1472 +/- ##
=======================================
Coverage 90.40% 90.40%
=======================================
Files 231 231
Lines 29718 29743 +25
Branches 6874 6878 +4
=======================================
+ Hits 26866 26890 +24
- Misses 1822 1824 +2
+ Partials 1030 1029 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
Looks good to me!
tests/api/test_authenticator.py
Outdated
assert isinstance(not_configured, CannotLoadConfiguration) | ||
assert "Could not instantiate MilleniumPatronAPI" in str(not_configured) | ||
|
||
# The integration has left it trace in initialization_exceptions. |
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.
Minor: typo -> "...left [its] trace..."
@@ -210,7 +210,7 @@ def test_libraries_get_with_multiple_libraries( | |||
FacetConstants.ORDER_TITLE, | |||
FacetConstants.ORDER_AUTHOR, | |||
] == settings_dict.get("facets_enabled_order") | |||
assert ["French"] == settings_dict.get("large_collection_languages") | |||
assert ["fre"] == settings_dict.get("large_collection_languages") |
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.
It's not obvious why this has changed.
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.
It changed because the call to update settings on line 176 now validates the settings before saving, which normalizes the language codes. That normalization is tested elsewhere, so I think its fine to just update the test here.
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 think it's fine, too. I just didn't understand it.
Description
While I was working on PP-501, I noticed we are loading / updating config settings in a number of places. This centralizes that in a couple functions, and adds classmethods for them to
HasIntegrationConfiguration
.Motivation and Context
Easier to work with integration settings.
How Has This Been Tested?
Checklist