mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
71: Proxy now uses base.__public__ instead of base.public; updated unit tests
This commit is contained in:
parent
778a019129
commit
f904cb0422
@ -139,7 +139,7 @@ class Proxy(ReadOnly):
|
||||
object.__setattr__(self, '_Proxy__base', base)
|
||||
object.__setattr__(self, '_Proxy__target', target)
|
||||
object.__setattr__(self, '_Proxy__name_attr', name_attr)
|
||||
object.__setattr__(self, '_Proxy__public', base.public)
|
||||
object.__setattr__(self, '_Proxy__public', base.__public__)
|
||||
object.__setattr__(self, 'name', getattr(target, name_attr))
|
||||
|
||||
# Check __public
|
||||
@ -228,7 +228,6 @@ class NameSpace(ReadOnly):
|
||||
return '%s(<%d proxies>)' % (self.__class__.__name__, len(self))
|
||||
|
||||
|
||||
|
||||
class Registrar(object):
|
||||
def __init__(self, *allowed):
|
||||
"""
|
||||
|
@ -27,7 +27,7 @@ import plugable
|
||||
|
||||
|
||||
class cmd(plugable.Plugin):
|
||||
public = frozenset((
|
||||
__public__ = frozenset((
|
||||
'__call__',
|
||||
'get_doc',
|
||||
'opt',
|
||||
@ -67,7 +67,7 @@ class cmd(plugable.Plugin):
|
||||
|
||||
|
||||
class obj(plugable.Plugin):
|
||||
public = frozenset((
|
||||
__public__ = frozenset((
|
||||
'mthd',
|
||||
'prop',
|
||||
))
|
||||
@ -127,14 +127,14 @@ class attr(plugable.Plugin):
|
||||
|
||||
|
||||
class mthd(attr, cmd):
|
||||
public = frozenset((
|
||||
__public__ = frozenset((
|
||||
'obj',
|
||||
'obj_name',
|
||||
))
|
||||
|
||||
|
||||
class prop(attr):
|
||||
public = frozenset((
|
||||
__public__ = frozenset((
|
||||
'obj',
|
||||
'obj_name',
|
||||
))
|
||||
|
@ -110,7 +110,7 @@ def test_Proxy():
|
||||
|
||||
# Setup:
|
||||
class base(object):
|
||||
public = frozenset((
|
||||
__public__ = frozenset((
|
||||
'public_0',
|
||||
'public_1',
|
||||
'__call__',
|
||||
@ -145,7 +145,7 @@ def test_Proxy():
|
||||
i = plugin()
|
||||
p = cls(base, i)
|
||||
assert read_only(p, 'name') == 'user_add'
|
||||
assert list(p) == sorted(base.public)
|
||||
assert list(p) == sorted(base.__public__)
|
||||
|
||||
# Test normal methods:
|
||||
for n in xrange(2):
|
||||
@ -184,7 +184,7 @@ def test_NameSpace():
|
||||
assert issubclass(cls, plugable.ReadOnly)
|
||||
|
||||
class base(object):
|
||||
public = frozenset((
|
||||
__public__ = frozenset((
|
||||
'plusplus',
|
||||
))
|
||||
|
||||
@ -353,7 +353,7 @@ def test_API():
|
||||
|
||||
# Setup the test bases, create the API:
|
||||
class base0(plugable.Plugin):
|
||||
public = frozenset((
|
||||
__public__ = frozenset((
|
||||
'method',
|
||||
))
|
||||
|
||||
@ -361,7 +361,7 @@ def test_API():
|
||||
return n
|
||||
|
||||
class base1(plugable.Plugin):
|
||||
public = frozenset((
|
||||
__public__ = frozenset((
|
||||
'method',
|
||||
))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user