summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc/test_group_plugin.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-01-16 10:24:03 -0500
committerRob Crittenden <rcritten@redhat.com>2009-01-19 10:40:11 -0500
commit0dd1ba37213dd088a4fd2a48ab478fa263877c1c (patch)
tree5692db1cb55124752f451548be1cd6adc4fb02d1 /tests/test_xmlrpc/test_group_plugin.py
parent322992ae4b4c6e45dbe7c850bb68198796bbfb92 (diff)
downloadfreeipa-0dd1ba37213dd088a4fd2a48ab478fa263877c1c.tar.gz
freeipa-0dd1ba37213dd088a4fd2a48ab478fa263877c1c.tar.xz
freeipa-0dd1ba37213dd088a4fd2a48ab478fa263877c1c.zip
Add some negative testing to the user and group plugin tests
Diffstat (limited to 'tests/test_xmlrpc/test_group_plugin.py')
-rw-r--r--tests/test_xmlrpc/test_group_plugin.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_group_plugin.py b/tests/test_xmlrpc/test_group_plugin.py
index 7ac88f294..2b16cc8a5 100644
--- a/tests/test_xmlrpc/test_group_plugin.py
+++ b/tests/test_xmlrpc/test_group_plugin.py
@@ -52,6 +52,15 @@ class test_Group(XMLRPC_test):
def test_add2(self):
"""
+ Test the `xmlrpc.group_add` method duplicate detection.
+ """
+ try:
+ res = api.Command['group_add'](**self.kw)
+ except errors.DuplicateEntry:
+ pass
+
+ def test_add2(self):
+ """
Test the `xmlrpc.group_add` method.
"""
self.kw['cn'] = self.cn2
@@ -69,6 +78,16 @@ class test_Group(XMLRPC_test):
res = api.Command['group_add_member'](self.cn, **kw)
assert res == []
+ def test_add_member2(self):
+ """
+ Test the `xmlrpc.group_add_member` with a non-existent member
+ """
+ kw={}
+ kw['groups'] = "notfound"
+ res = api.Command['group_add_member'](self.cn, **kw)
+ # an error isn't thrown, the list of failed members is returned
+ assert res != []
+
def test_doshow(self):
"""
Test the `xmlrpc.group_show` method.
@@ -118,6 +137,16 @@ class test_Group(XMLRPC_test):
assert res
assert res.get('member','') == ''
+ def test_remove_member2(self):
+ """
+ Test the `xmlrpc.group_remove_member` method with non-member
+ """
+ kw={}
+ kw['groups'] = "notfound"
+ # an error isn't thrown, the list of failed members is returned
+ res = api.Command['group_remove_member'](self.cn, **kw)
+ assert res != []
+
def test_remove_x(self):
"""
Test the `xmlrpc.group_del` method.