Skip to content
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

Allow initialize with unrecognized settings #117

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,6 @@ def __validate_settings(settings: dict):
Parses the supplied settings dict, raising if there are any
unrecognized keys present.
"""
defaults = BasicAssetLibraryInterface.__make_default_settings()

if SETTINGS_KEY_LIBRARY_PATH in settings:
if not isinstance(settings[SETTINGS_KEY_LIBRARY_PATH], str):
raise ValueError(f"{SETTINGS_KEY_LIBRARY_PATH} must be a str")
Expand All @@ -715,10 +713,6 @@ def __validate_settings(settings: dict):
"legal URL scheme characters (a-z, A-Z, 0-9, -)"
)

for key in settings:
if key not in defaults:
raise KeyError(f"Unknown setting '{key}'")


class BALEntityReferencePagerInterface(EntityReferencePagerInterface):
"""
Expand Down
6 changes: 0 additions & 6 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@
"entity_reference_url_scheme": "thingy",
}
},
"test_when_settings_have_invalid_keys_then_all_settings_unchanged": {
"some_settings_with_new_values_and_invalid_keys": {"library_path": "", "cat": True}
},
"test_when_settings_have_invalid_keys_then_raises_KeyError": {
"some_settings_with_new_values_and_invalid_keys": {"library_path": "", "cat": True}
},
"test_when_settings_have_subset_of_keys_then_other_settings_unchanged": {
"some_settings_with_a_subset_of_keys": {"simulated_query_latency_ms": 2}
},
Expand Down
Loading