def test_is_dict(self): et = {'test': 123} dicts = [i(et) for i in Dict.__supported_classes__] for i in dicts: self.assertEqual(Dict.is_dict(i), True) for i in TestType.all_items: self.assertEqual(Dict.is_dict(i), False)
def set_default_type(k, v): if Dict.is_dict(v): return (k, Close(v)) elif Dict.is_list(v): return (k, Dict.is_type(v)([None if isinstance(i, type) else i for i in v])) else: return (k, None if isinstance(v, type) else v)
def enabled(obj: Dict): return Dict.is_dict(obj.get('__vault__'))