diff options
author | Martin Nagy <mnagy@redhat.com> | 2008-09-29 17:41:30 +0200 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-29 17:45:14 -0600 |
commit | afdc72103847fc27efd00f8cc97a7320909ff6a0 (patch) | |
tree | 0e2bf04bb5d483b96ee43b218e759986d9af7b06 /ipalib/tests | |
parent | d77907d2d0ecc33ef4ee4121e10cfef385172b0d (diff) | |
download | freeipa-afdc72103847fc27efd00f8cc97a7320909ff6a0.tar.gz freeipa-afdc72103847fc27efd00f8cc97a7320909ff6a0.tar.xz freeipa-afdc72103847fc27efd00f8cc97a7320909ff6a0.zip |
Add support for environment variables, change tests accordingly
Diffstat (limited to 'ipalib/tests')
-rw-r--r-- | ipalib/tests/test_crud.py | 3 | ||||
-rw-r--r-- | ipalib/tests/test_frontend.py | 8 | ||||
-rw-r--r-- | ipalib/tests/test_plugable.py | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/ipalib/tests/test_crud.py b/ipalib/tests/test_crud.py index 8b1e8a86e..e95fe5092 100644 --- a/ipalib/tests/test_crud.py +++ b/ipalib/tests/test_crud.py @@ -22,10 +22,11 @@ Unit tests for `ipalib.crud` module. """ from tstutil import read_only, raises, ClassChecker -from ipalib import crud, frontend, plugable +from ipalib import crud, frontend, plugable, config def get_api(): api = plugable.API( + config.default_environment(), frontend.Object, frontend.Method, frontend.Property, diff --git a/ipalib/tests/test_frontend.py b/ipalib/tests/test_frontend.py index f0ada896d..e3dd04fac 100644 --- a/ipalib/tests/test_frontend.py +++ b/ipalib/tests/test_frontend.py @@ -23,7 +23,7 @@ Unit tests for `ipalib.frontend` module. from tstutil import raises, getitem, no_set, no_del, read_only, ClassChecker from tstutil import check_TypeError -from ipalib import frontend, backend, plugable, errors, ipa_types +from ipalib import frontend, backend, plugable, errors, ipa_types, config def test_RULE_FLAG(): @@ -732,7 +732,7 @@ class test_Command(ClassChecker): kw = dict(how_are='you', on_this='fine day?') # Test in server context: - api = plugable.API(self.cls, in_server_context=True) + api = plugable.API(dict(server_context=True), self.cls) api.finalize() o = my_cmd() o.set_api(api) @@ -741,7 +741,7 @@ class test_Command(ClassChecker): assert o.run.im_func is my_cmd.execute.im_func # Test in non-server context - api = plugable.API(self.cls, in_server_context=False) + api = plugable.API(dict(server_context=False), self.cls) api.finalize() o = my_cmd() o.set_api(api) @@ -868,6 +868,7 @@ class test_Object(ClassChecker): Test the `frontend.Object.primary_key` attribute. """ api = plugable.API( + config.default_environment(), frontend.Method, frontend.Property, ) @@ -922,6 +923,7 @@ class test_Object(ClassChecker): Test the `frontend.Object.backend` attribute. """ api = plugable.API( + config.default_environment(), frontend.Object, frontend.Method, frontend.Property, diff --git a/ipalib/tests/test_plugable.py b/ipalib/tests/test_plugable.py index 95d3825f7..9be6b343e 100644 --- a/ipalib/tests/test_plugable.py +++ b/ipalib/tests/test_plugable.py @@ -742,7 +742,7 @@ def test_API(): def method(self, n): return n + 1 - api = plugable.API(base0, base1) + api = plugable.API(dict(), base0, base1) r = api.register assert isinstance(r, plugable.Registrar) assert read_only(api, 'register') is r @@ -800,7 +800,7 @@ def test_API(): # Test with base class that doesn't request a proxy class NoProxy(plugable.Plugin): __proxy__ = False - api = plugable.API(NoProxy) + api = plugable.API(dict(), NoProxy) class plugin0(NoProxy): pass api.register(plugin0) |