mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix little test errors
Two test methods in test_rpcserver had the same name; the first didn't get to run. Another duplicate pair was in test_hbac_plugin with the same name; the ignored test had small error in it. check_TypeError used a wrong constant name An error reporting function in test.util used uninitialized argument names. This patch fixes these problems.
This commit is contained in:
committed by
Rob Crittenden
parent
c007ac0d70
commit
b0a5524028
@@ -96,7 +96,7 @@ def test_internal_error():
|
||||
assert s.headers == [('Content-Type', 'text/html; charset=utf-8')]
|
||||
|
||||
|
||||
def test_internal_error():
|
||||
def test_unauthorized_error():
|
||||
f = rpcserver.HTTP_Status()
|
||||
t = rpcserver._unauthorized_template
|
||||
s = StartResponse()
|
||||
@@ -109,7 +109,6 @@ def test_internal_error():
|
||||
assert s.headers == [('Content-Type', 'text/html; charset=utf-8')]
|
||||
|
||||
|
||||
|
||||
def test_params_2_args_options():
|
||||
"""
|
||||
Test the `ipaserver.rpcserver.params_2_args_options` function.
|
||||
|
@@ -265,8 +265,8 @@ class test_hbac(XMLRPC_test):
|
||||
assert 'hostgroup' in failed['memberhost']
|
||||
assert not failed['memberhost']['hostgroup']
|
||||
entry = ret['result']
|
||||
assert 'memberhost_host' not in res[1]
|
||||
assert 'memberhost_hostgroup' not in res[1]
|
||||
assert 'memberhost_host' not in entry
|
||||
assert 'memberhost_hostgroup' not in entry
|
||||
|
||||
def test_a_hbacrule_add_sourcehost(self):
|
||||
"""
|
||||
@@ -327,7 +327,7 @@ class test_hbac(XMLRPC_test):
|
||||
entry = ret['result']
|
||||
assert 'memberservice service' not in entry
|
||||
|
||||
def test_b_hbacrule_remove_host(self):
|
||||
def test_b_hbacrule_remove_sourcehost(self):
|
||||
"""
|
||||
Test removing source host and hostgroup from HBAC rule using `xmlrpc.hbacrule_remove_host`.
|
||||
"""
|
||||
|
@@ -446,7 +446,7 @@ def check_TypeError(value, type_, name, callback, *args, **kw):
|
||||
assert e.type is type_
|
||||
assert e.name == name
|
||||
assert type(e.name) is str
|
||||
assert str(e) == ipalib.errors.TYPE_FORMAT % (name, type_, value)
|
||||
assert str(e) == ipalib.errors.TYPE_ERROR % (name, type_, value)
|
||||
return e
|
||||
|
||||
|
||||
@@ -592,7 +592,7 @@ class DummyClass(object):
|
||||
def __process(self, name_, args_, kw_):
|
||||
if self.__i >= len(self.__calls):
|
||||
raise AssertionError(
|
||||
'extra call: %s, %r, %r' % (name, args, kw)
|
||||
'extra call: %s, %r, %r' % (name_, args_, kw_)
|
||||
)
|
||||
(name, args, kw, result) = self.__calls[self.__i]
|
||||
self.__i += 1
|
||||
|
Reference in New Issue
Block a user