From 54a522f161d40ac82ea04151a087a67d17939943 Mon Sep 17 00:00:00 2001 From: Viraj Patel Date: Fri, 2 Sep 2022 08:16:53 +0000 Subject: [PATCH] chore: revert changes --- aea/test_tools/generic.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aea/test_tools/generic.py b/aea/test_tools/generic.py index b9adc8267a..d55ad6bc31 100644 --- a/aea/test_tools/generic.py +++ b/aea/test_tools/generic.py @@ -117,10 +117,13 @@ def get_nested_ordered_dict_from_keys_and_value( return _dic root_key = keys[0] - if isinstance(configuration_obj, SkillConfig): + if ( + isinstance(configuration_obj, SkillConfig) + and root_key in SkillConfig.FIELDS_WITH_NESTED_FIELDS + ): root_attr = getattr(configuration_obj, root_key) length = len(keys) - if length < 3: + if length < 3 or keys[2] not in SkillConfig.NESTED_FIELDS_ALLOWED_TO_UPDATE: raise ValueError(f"Invalid keys={keys}.") # pragma: nocover skill_component_id = keys[1] skill_component_config = root_attr.read(skill_component_id)