mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
160: DictProxy now checks type of d in __init__(); updated unit tests
This commit is contained in:
@@ -484,6 +484,7 @@ class DictProxy(ReadOnly):
|
||||
"""
|
||||
:param d: The ``dict`` instance to proxy.
|
||||
"""
|
||||
assert type(d) is dict, '`d` must be %r, got %r' % (dict, type(d))
|
||||
self.__d = d
|
||||
self.__lock__()
|
||||
assert self.__islocked__()
|
||||
|
||||
@@ -461,6 +461,8 @@ class test_DictProxy(ClassChecker):
|
||||
|
||||
def test_class(self):
|
||||
assert self.cls.__bases__ == (plugable.ReadOnly,)
|
||||
for non_dict in ('hello', 69, object):
|
||||
raises(AssertionError, self.cls, non_dict)
|
||||
|
||||
def test_DictProxy(self):
|
||||
cnt = 10
|
||||
|
||||
Reference in New Issue
Block a user