From 7721443a625b2efd0744ad347c62795e5ba6bb91 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 7 Oct 2008 20:41:15 -0600 Subject: Moved ipalib/tests/ into tests/test_ipalib/ --- tests/test_ipalib/test_backend.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/test_ipalib/test_backend.py (limited to 'tests/test_ipalib/test_backend.py') diff --git a/tests/test_ipalib/test_backend.py b/tests/test_ipalib/test_backend.py new file mode 100644 index 00000000..967e9fdf --- /dev/null +++ b/tests/test_ipalib/test_backend.py @@ -0,0 +1,37 @@ +# Authors: +# Jason Gerard DeRose +# +# Copyright (C) 2008 Red Hat +# see file 'COPYING' for use and warranty information +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; version 2 only +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +""" +Unit tests for `ipalib.backend` module. +""" + +from ipalib import backend, plugable, errors +from tstutil import ClassChecker + + +class test_Backend(ClassChecker): + """ + Test the `backend.Backend` class. + """ + + _cls = backend.Backend + + def test_class(self): + assert self.cls.__bases__ == (plugable.Plugin,) + assert self.cls.__proxy__ is False -- cgit From af56c71d506c2573f99a1ca8334cfa90dc7f74d7 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 7 Oct 2008 21:25:23 -0600 Subject: Cleaned up package and module level docstrings for everything in tests/ --- tests/test_ipalib/test_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_ipalib/test_backend.py') diff --git a/tests/test_ipalib/test_backend.py b/tests/test_ipalib/test_backend.py index 967e9fdf..ddf66540 100644 --- a/tests/test_ipalib/test_backend.py +++ b/tests/test_ipalib/test_backend.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -Unit tests for `ipalib.backend` module. +Test the `ipalib.backend` module. """ from ipalib import backend, plugable, errors -- cgit From f6ac2df6bd7ceddd0f3eb968198cc3ebd1388087 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 7 Oct 2008 21:59:47 -0600 Subject: Moved tstutil.py into base of tests so it can be used by all test subpackages more easily --- tests/test_ipalib/test_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_ipalib/test_backend.py') diff --git a/tests/test_ipalib/test_backend.py b/tests/test_ipalib/test_backend.py index ddf66540..07c5eb00 100644 --- a/tests/test_ipalib/test_backend.py +++ b/tests/test_ipalib/test_backend.py @@ -22,7 +22,7 @@ Test the `ipalib.backend` module. """ from ipalib import backend, plugable, errors -from tstutil import ClassChecker +from tests.tstutil import ClassChecker class test_Backend(ClassChecker): -- cgit From deb8e3dfc899cfc7ee31f47c1ba7c4301c58fc51 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 7 Oct 2008 22:30:53 -0600 Subject: Renamed tests/tstutil.py to tests/util.py --- tests/test_ipalib/test_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_ipalib/test_backend.py') diff --git a/tests/test_ipalib/test_backend.py b/tests/test_ipalib/test_backend.py index 07c5eb00..cd490fe0 100644 --- a/tests/test_ipalib/test_backend.py +++ b/tests/test_ipalib/test_backend.py @@ -22,7 +22,7 @@ Test the `ipalib.backend` module. """ from ipalib import backend, plugable, errors -from tests.tstutil import ClassChecker +from tests.util import ClassChecker class test_Backend(ClassChecker): -- cgit From ddb5449c7faabbd4c1b71adfe84c386b943a163f Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 30 Oct 2008 01:11:33 -0600 Subject: Did some initial work for Context plugins --- tests/test_ipalib/test_backend.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'tests/test_ipalib/test_backend.py') diff --git a/tests/test_ipalib/test_backend.py b/tests/test_ipalib/test_backend.py index cd490fe0..88bd2da4 100644 --- a/tests/test_ipalib/test_backend.py +++ b/tests/test_ipalib/test_backend.py @@ -22,12 +22,12 @@ Test the `ipalib.backend` module. """ from ipalib import backend, plugable, errors -from tests.util import ClassChecker +from tests.util import ClassChecker, raises class test_Backend(ClassChecker): """ - Test the `backend.Backend` class. + Test the `ipalib.backend.Backend` class. """ _cls = backend.Backend @@ -35,3 +35,21 @@ class test_Backend(ClassChecker): def test_class(self): assert self.cls.__bases__ == (plugable.Plugin,) assert self.cls.__proxy__ is False + + +class test_Context(ClassChecker): + """ + Test the `ipalib.backend.Context` class. + """ + + _cls = backend.Context + + def test_get_value(self): + """ + Test the `ipalib.backend.Context.get_value` method. + """ + class Subclass(self.cls): + pass + o = Subclass() + e = raises(NotImplementedError, o.get_value) + assert str(e) == 'Subclass.get_value()' -- cgit