aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo_gsm_tester/util.py')
-rw-r--r--src/osmo_gsm_tester/util.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index 61d0f6e..e132e21 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -74,6 +74,7 @@ class DictProxy:
return dict2obj(self.obj[key])
def __getattr__(self, key):
+ 'provide error information to know which template item was missing'
try:
return dict2obj(getattr(self.obj, key))
except AttributeError:
@@ -82,19 +83,9 @@ class DictProxy:
except KeyError:
raise AttributeError(key)
-class ListProxy:
- 'allow nesting for DictProxy'
- def __init__(self, obj):
- self.obj = obj
-
- def __getitem__(self, key):
- return dict2obj(self.obj[key])
-
def dict2obj(value):
- if isinstance(value, dict):
+ if is_list(value) or is_dict(value):
return DictProxy(value)
- if isinstance(value, (tuple, list)):
- return ListProxy(value)
return value