From 6f144fbaf062d9644af06fdd11020e3d5d349639 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Fri, 8 Aug 2008 22:13:49 +0000 Subject: 89: Moved ClassChecker from test_public.py into tstutil.py; improved unit tests for plugable.ReadOnly --- ipalib/tests/test_public.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'ipalib/tests/test_public.py') diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py index 6bff9d89..83fd65c1 100644 --- a/ipalib/tests/test_public.py +++ b/ipalib/tests/test_public.py @@ -21,7 +21,7 @@ Unit tests for `ipalib.public` module. """ -from tstutil import raises, getitem, no_set, no_del, read_only +from tstutil import raises, getitem, no_set, no_del, read_only, ClassChecker from ipalib import public, plugable, errors @@ -63,27 +63,7 @@ def test_is_rule(): assert not is_rule(call(None)) -class ClassChecker(object): - __cls = None - __subcls = None - def __get_cls(self): - if self.__cls is None: - self.__cls = self._cls - return self.__cls - cls = property(__get_cls) - - def __get_subcls(self): - if self.__subcls is None: - self.__subcls = self.get_subcls() - return self.__subcls - subcls = property(__get_subcls) - - def get_subcls(self): - raise NotImplementedError( - self.__class__.__name__, - 'get_subcls()' - ) class test_option(ClassChecker): -- cgit