diff options
author | Ghostkeeper <rubend@tutanota.com> | 2019-10-18 17:57:57 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2019-10-18 17:57:57 +0300 |
commit | 76b5f9d37b05cd3a86ac01864c53b9051ad3997c (patch) | |
tree | d1f1d6b4a55f3fdc6e163a4c247e5dab9f51126e /tests/Settings | |
parent | b24dad156383431fcc63bed05415e724ef1fe81a (diff) |
Fix testing if JSON elements are mappings
Turns out that the JSON objects extend from dict, so this works.
Also turns out that strings have a __getitem__. Who knew?
Done during Turbo Testing & Tooling.
Diffstat (limited to 'tests/Settings')
-rw-r--r-- | tests/Settings/TestDefinitionContainer.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/Settings/TestDefinitionContainer.py b/tests/Settings/TestDefinitionContainer.py index 0941840a05..3a54fc1bed 100644 --- a/tests/Settings/TestDefinitionContainer.py +++ b/tests/Settings/TestDefinitionContainer.py @@ -104,7 +104,7 @@ def merge_dicts(base: Dict[str, Any], overrides: Dict[str, Any]) -> Dict[str, An result[key] = val continue - if hasattr(result[key], "__getitem__") and hasattr(val, "__getitem__"): # Duck typing of dicts. Also works with JSON documents for sure. + if isinstance(result[key], dict) and isinstance(val, dict): result[key] = merge_dicts(result[key], val) else: result[key] = val |