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') diff --git a/tests/test_ipalib/test_backend.py b/tests/test_ipalib/test_backend.py index cd490fe04..88bd2da47 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