mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fixed Warning messages about log dir in unit test
This commit is contained in:
parent
4591057203
commit
7e21ea5ad8
@ -123,7 +123,7 @@ def _(text):
|
|||||||
|
|
||||||
class HandledError(StandardError):
|
class HandledError(StandardError):
|
||||||
"""
|
"""
|
||||||
Base class for errors that can be raised across a remote procecdure call.
|
Base class for errors that can be raised across a remote procedure call.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
code = 1
|
code = 1
|
||||||
@ -135,7 +135,6 @@ class HandledError(StandardError):
|
|||||||
StandardError.__init__(self, message)
|
StandardError.__init__(self, message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class UnknownError(HandledError):
|
class UnknownError(HandledError):
|
||||||
"""
|
"""
|
||||||
Raised when the true error is not a handled error.
|
Raised when the true error is not a handled error.
|
||||||
@ -145,10 +144,12 @@ class UnknownError(HandledError):
|
|||||||
|
|
||||||
|
|
||||||
class CommandError(HandledError):
|
class CommandError(HandledError):
|
||||||
|
"""
|
||||||
|
Raised when an unknown command is called client-side.
|
||||||
|
"""
|
||||||
format = _('Unknown command %(name)r')
|
format = _('Unknown command %(name)r')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RemoteCommandError(HandledError):
|
class RemoteCommandError(HandledError):
|
||||||
format = 'Server at %(uri)r has no command %(name)r'
|
format = 'Server at %(uri)r has no command %(name)r'
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ do
|
|||||||
if [[ -f $executable ]]; then
|
if [[ -f $executable ]]; then
|
||||||
echo "[ $name: Starting tests... ]"
|
echo "[ $name: Starting tests... ]"
|
||||||
((runs += 1))
|
((runs += 1))
|
||||||
if $executable /usr/bin/nosetests --with-doctest --stop
|
if $executable /usr/bin/nosetests -v --with-doctest --stop
|
||||||
then
|
then
|
||||||
echo "[ $name: Tests OK ]"
|
echo "[ $name: Tests OK ]"
|
||||||
else
|
else
|
||||||
|
@ -74,3 +74,7 @@ class test_xmlrpc(PluginTester):
|
|||||||
options = dict(option1=u'How are you?', option2=unicode_str)
|
options = dict(option1=u'How are you?', option2=unicode_str)
|
||||||
assert call((arg1, arg2, options)) == (arg1, arg2, options)
|
assert call((arg1, arg2, options)) == (arg1, arg2, options)
|
||||||
assert call((arg1,) + arg2 + (options,)) == (arg1, arg2, options)
|
assert call((arg1,) + arg2 + (options,)) == (arg1, arg2, options)
|
||||||
|
|
||||||
|
|
||||||
|
def test_execute(self):
|
||||||
|
(o, api, home) = self.instance('Backend', in_server=True)
|
||||||
|
@ -22,7 +22,7 @@ Test the `ipalib.frontend` module.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from tests.util import raises, getitem, no_set, no_del, read_only
|
from tests.util import raises, getitem, no_set, no_del, read_only
|
||||||
from tests.util import check_TypeError, ClassChecker, get_api
|
from tests.util import check_TypeError, ClassChecker, create_test_api
|
||||||
from ipalib import frontend, backend, plugable, errors, ipa_types, config
|
from ipalib import frontend, backend, plugable, errors, ipa_types, config
|
||||||
|
|
||||||
|
|
||||||
@ -790,9 +790,7 @@ class test_Command(ClassChecker):
|
|||||||
kw = dict(how_are='you', on_this='fine day?')
|
kw = dict(how_are='you', on_this='fine day?')
|
||||||
|
|
||||||
# Test in server context:
|
# Test in server context:
|
||||||
api = plugable.API(self.cls)
|
(api, home) = create_test_api(in_server=True)
|
||||||
#api.env.update(dict(server_context=True))
|
|
||||||
api.env.in_server = True
|
|
||||||
api.finalize()
|
api.finalize()
|
||||||
o = my_cmd()
|
o = my_cmd()
|
||||||
o.set_api(api)
|
o.set_api(api)
|
||||||
@ -801,9 +799,7 @@ class test_Command(ClassChecker):
|
|||||||
assert o.run.im_func is my_cmd.execute.im_func
|
assert o.run.im_func is my_cmd.execute.im_func
|
||||||
|
|
||||||
# Test in non-server context
|
# Test in non-server context
|
||||||
api = plugable.API(self.cls)
|
(api, home) = create_test_api(in_server=False)
|
||||||
#api.env.update(dict(server_context=False))
|
|
||||||
api.env.in_server = False
|
|
||||||
api.finalize()
|
api.finalize()
|
||||||
o = my_cmd()
|
o = my_cmd()
|
||||||
o.set_api(api)
|
o.set_api(api)
|
||||||
@ -844,7 +840,7 @@ class test_LocalOrRemote(ClassChecker):
|
|||||||
return ('execute', args, options)
|
return ('execute', args, options)
|
||||||
|
|
||||||
# Test when in_server=False:
|
# Test when in_server=False:
|
||||||
(api, home) = get_api(in_server=False)
|
(api, home) = create_test_api(in_server=False)
|
||||||
api.register(example)
|
api.register(example)
|
||||||
api.finalize()
|
api.finalize()
|
||||||
cmd = api.Command.example
|
cmd = api.Command.example
|
||||||
@ -855,7 +851,7 @@ class test_LocalOrRemote(ClassChecker):
|
|||||||
('forward', (u'var',), dict(server=True))
|
('forward', (u'var',), dict(server=True))
|
||||||
|
|
||||||
# Test when in_server=True (should always call execute):
|
# Test when in_server=True (should always call execute):
|
||||||
(api, home) = get_api(in_server=True)
|
(api, home) = create_test_api(in_server=True)
|
||||||
api.register(example)
|
api.register(example)
|
||||||
api.finalize()
|
api.finalize()
|
||||||
cmd = api.Command.example
|
cmd = api.Command.example
|
||||||
@ -986,11 +982,7 @@ class test_Object(ClassChecker):
|
|||||||
"""
|
"""
|
||||||
Test the `ipalib.frontend.Object.primary_key` attribute.
|
Test the `ipalib.frontend.Object.primary_key` attribute.
|
||||||
"""
|
"""
|
||||||
api = plugable.API(
|
(api, home) = create_test_api()
|
||||||
frontend.Method,
|
|
||||||
frontend.Property,
|
|
||||||
)
|
|
||||||
#config.set_default_env(api.env)
|
|
||||||
api.finalize()
|
api.finalize()
|
||||||
|
|
||||||
# Test with no primary keys:
|
# Test with no primary keys:
|
||||||
@ -1041,13 +1033,7 @@ class test_Object(ClassChecker):
|
|||||||
"""
|
"""
|
||||||
Test the `ipalib.frontend.Object.backend` attribute.
|
Test the `ipalib.frontend.Object.backend` attribute.
|
||||||
"""
|
"""
|
||||||
api = plugable.API(
|
(api, home) = create_test_api()
|
||||||
frontend.Object,
|
|
||||||
frontend.Method,
|
|
||||||
frontend.Property,
|
|
||||||
backend.Backend,
|
|
||||||
)
|
|
||||||
#config.set_default_env(api.env)
|
|
||||||
class ldap(backend.Backend):
|
class ldap(backend.Backend):
|
||||||
whatever = 'It worked!'
|
whatever = 'It worked!'
|
||||||
api.register(ldap)
|
api.register(ldap)
|
||||||
|
@ -23,7 +23,7 @@ Test the `ipalib.plugable` module.
|
|||||||
|
|
||||||
from tests.util import raises, no_set, no_del, read_only
|
from tests.util import raises, no_set, no_del, read_only
|
||||||
from tests.util import getitem, setitem, delitem
|
from tests.util import getitem, setitem, delitem
|
||||||
from tests.util import ClassChecker, get_api
|
from tests.util import ClassChecker, create_test_api
|
||||||
from ipalib import plugable, errors
|
from ipalib import plugable, errors
|
||||||
|
|
||||||
|
|
||||||
@ -860,6 +860,7 @@ class test_API(ClassChecker):
|
|||||||
class NoProxy(plugable.Plugin):
|
class NoProxy(plugable.Plugin):
|
||||||
__proxy__ = False
|
__proxy__ = False
|
||||||
api = plugable.API(NoProxy)
|
api = plugable.API(NoProxy)
|
||||||
|
api.env.mode = 'unit_test'
|
||||||
class plugin0(NoProxy):
|
class plugin0(NoProxy):
|
||||||
pass
|
pass
|
||||||
api.register(plugin0)
|
api.register(plugin0)
|
||||||
@ -879,7 +880,7 @@ class test_API(ClassChecker):
|
|||||||
"""
|
"""
|
||||||
Test the `ipalib.plugable.API.bootstrap` method.
|
Test the `ipalib.plugable.API.bootstrap` method.
|
||||||
"""
|
"""
|
||||||
(o, home) = get_api()
|
(o, home) = create_test_api()
|
||||||
assert o.env._isdone('_bootstrap') is False
|
assert o.env._isdone('_bootstrap') is False
|
||||||
assert o.env._isdone('_finalize_core') is False
|
assert o.env._isdone('_finalize_core') is False
|
||||||
assert o.isdone('bootstrap') is False
|
assert o.isdone('bootstrap') is False
|
||||||
@ -895,7 +896,7 @@ class test_API(ClassChecker):
|
|||||||
"""
|
"""
|
||||||
Test the `ipalib.plugable.API.load_plugins` method.
|
Test the `ipalib.plugable.API.load_plugins` method.
|
||||||
"""
|
"""
|
||||||
(o, home) = get_api()
|
(o, home) = create_test_api()
|
||||||
assert o.isdone('bootstrap') is False
|
assert o.isdone('bootstrap') is False
|
||||||
assert o.isdone('load_plugins') is False
|
assert o.isdone('load_plugins') is False
|
||||||
o.load_plugins()
|
o.load_plugins()
|
||||||
|
Loading…
Reference in New Issue
Block a user