mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add some negative testing to the user and group plugin tests
This commit is contained in:
@@ -50,6 +50,15 @@ class test_Group(XMLRPC_test):
|
||||
assert res.get('description','') == self.description
|
||||
assert res.get('cn','') == self.cn
|
||||
|
||||
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.
|
||||
@@ -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.
|
||||
|
||||
@@ -54,6 +54,15 @@ class test_User(XMLRPC_test):
|
||||
assert res.get('uid','') == self.uid
|
||||
assert res.get('homedirectory','') == self.home
|
||||
|
||||
def test_add2(self):
|
||||
"""
|
||||
Test the `xmlrpc.user_add` method duplicate detection.
|
||||
"""
|
||||
try:
|
||||
res = api.Command['user_add'](**self.kw)
|
||||
except errors.DuplicateEntry:
|
||||
pass
|
||||
|
||||
def test_doshow(self):
|
||||
"""
|
||||
Test the `xmlrpc.user_show` method.
|
||||
|
||||
Reference in New Issue
Block a user