summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-01-22 09:58:35 -0700
committerRob Crittenden <rcritten@redhat.com>2009-02-03 15:29:00 -0500
commit6aadeb9aea60165d9c68b348dae4df456b00dfc4 (patch)
tree93f957952dd32d52eef0197d533df601b7804925 /tests/test_ipalib
parent529819b02b1c6e78b85481b417ae896b7237f0e2 (diff)
downloadfreeipa-6aadeb9aea60165d9c68b348dae4df456b00dfc4.tar.gz
freeipa-6aadeb9aea60165d9c68b348dae4df456b00dfc4.tar.xz
freeipa-6aadeb9aea60165d9c68b348dae4df456b00dfc4.zip
Added Object.params_minus() method; various small tweaks
Diffstat (limited to 'tests/test_ipalib')
-rw-r--r--tests/test_ipalib/test_frontend.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_ipalib/test_frontend.py b/tests/test_ipalib/test_frontend.py
index 0030a41e5..1e90dbb34 100644
--- a/tests/test_ipalib/test_frontend.py
+++ b/tests/test_ipalib/test_frontend.py
@@ -25,6 +25,7 @@ from tests.util import raises, getitem, no_set, no_del, read_only
from tests.util import check_TypeError, ClassChecker, create_test_api
from tests.util import assert_equal
from ipalib.constants import TYPE_ERROR
+from ipalib.base import NameSpace
from ipalib import frontend, backend, plugable, errors2, errors, parameters, config
@@ -638,6 +639,25 @@ class test_Object(ClassChecker):
e = raises(NotImplementedError, o.get_dn, 'primary key')
assert str(e) == 'user.get_dn()'
+ def test_params_minus(self):
+ """
+ Test the `ipalib.frontend.Object.params_minus` method.
+ """
+ class example(self.cls):
+ takes_params = ('one', 'two', 'three', 'four')
+ o = example()
+ (api, home) = create_test_api()
+ o.set_api(api)
+ p = o.params
+ assert tuple(o.params_minus()) == tuple(p())
+ assert tuple(o.params_minus([])) == tuple(p())
+ assert tuple(o.params_minus('two', 'three')) == (p.one, p.four)
+ assert tuple(o.params_minus(['two', 'three'])) == (p.one, p.four)
+ assert tuple(o.params_minus(p.two, p.three)) == (p.one, p.four)
+ assert tuple(o.params_minus([p.two, p.three])) == (p.one, p.four)
+ ns = NameSpace([p.two, p.three])
+ assert tuple(o.params_minus(ns)) == (p.one, p.four)
+
class test_Attribute(ClassChecker):
"""