From 7335af8a9eb4b5ab6a0884f686a51a050464320b Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 7 Aug 2008 00:14:38 +0000 Subject: 68: Ported to changes in NameSpace, Proxy; updated unit tests --- ipalib/tests/test_plugable.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ipalib/tests/test_plugable.py') diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py index 0e170564..ebc3a78f 100644 --- a/ipalib/tests/test_plugable.py +++ b/ipalib/tests/test_plugable.py @@ -352,18 +352,19 @@ def test_Registrar(): def test_API(): assert issubclass(plugable.API, plugable.ReadOnly) - # Setup the test plugins, create the Registrar: - class ExampleProxy(plugable.Proxy): - __slots__ = ['method'] - + # Setup the test bases, create the API: class base0(plugable.Plugin): - proxy = ExampleProxy + public = frozenset(( + 'method', + )) def method(self, n): return n class base1(plugable.Plugin): - proxy = ExampleProxy + public = frozenset(( + 'method', + )) def method(self, n): return n + 1 @@ -415,7 +416,7 @@ def test_API(): for p in xrange(3): plugin_name = get_plugin(b, p) proxy = ns[plugin_name] - assert isinstance(proxy, ExampleProxy) + assert isinstance(proxy, plugable.Proxy) assert proxy.name == plugin_name assert read_only(ns, plugin_name) is proxy assert read_only(proxy, 'method')(7) == 7 + b -- cgit