summaryrefslogtreecommitdiffstats
path: root/ipalib/tests/test_plugable.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-08-05 05:12:09 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-08-05 05:12:09 +0000
commitd134b483066ae9d3a7e76d6e491f0f91eba6a954 (patch)
tree9e2a4a588b140c05cd8d29585a6b3c5355454f71 /ipalib/tests/test_plugable.py
parent2b3c2238f6ecb5fc496acc50fc81f5b658d23c4b (diff)
downloadfreeipa.git-d134b483066ae9d3a7e76d6e491f0f91eba6a954.tar.gz
freeipa.git-d134b483066ae9d3a7e76d6e491f0f91eba6a954.tar.xz
freeipa.git-d134b483066ae9d3a7e76d6e491f0f91eba6a954.zip
46: plugable.API now takes allowed base class in __init__ and creates Registrar at API.register, thereby coupling the two; updated correspending unit tests
Diffstat (limited to 'ipalib/tests/test_plugable.py')
-rw-r--r--ipalib/tests/test_plugable.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py
index 27841e2e..2e87ea2c 100644
--- a/ipalib/tests/test_plugable.py
+++ b/ipalib/tests/test_plugable.py
@@ -334,7 +334,10 @@ def test_API():
def method(self, n):
return n + 1
- r = plugable.Registrar(base0, base1)
+ api = plugable.API(base0, base1)
+ r = api.register
+ assert isinstance(r, plugable.Registrar)
+ assert read_only(api, 'register') is r
class base0_plugin0(base0):
pass
@@ -360,10 +363,8 @@ def test_API():
pass
r(base1_plugin2)
- registrants = tuple(r)
-
# Test API instance:
- api = plugable.API(r)
+ api() # Calling instance performs finalization
def get_base(b):
return 'base%d' % b