Skip to content

Commit

Permalink
Merge pull request #117 from feltech/work/allowUnknownSettings
Browse files Browse the repository at this point in the history
Allow `initialize` with unrecognized settings
  • Loading branch information
feltech authored Jul 19, 2024
2 parents fb8456c + a914f98 commit 465795f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions plugin/openassetio_manager_bal/BasicAssetLibraryInterface.py
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

0 comments on commit 465795f

Please sign in to comment.