From af52671e132818deaf266cd434338aff11064f01 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Fri, 22 Aug 2008 21:50:53 +0000 Subject: 187: Renamed plubic.obj to Object; reworked plublic.Object unit tests to use ClassChecker --- ipalib/tests/test_public.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'ipalib/tests/test_public.py') diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py index a6ae7d8e..95bb7b9c 100644 --- a/ipalib/tests/test_public.py +++ b/ipalib/tests/test_public.py @@ -321,10 +321,21 @@ class test_cmd(ClassChecker): assert 'execute' in self.cls.__public__ # Public -def test_obj(): - cls = public.obj - assert issubclass(cls, plugable.Plugin) +class test_Object(ClassChecker): + """ + Tests the `public.Object` class. + """ + _cls = public.Object + + def test_class(self): + assert self.cls.__bases__ == (plugable.Plugin,) + assert type(self.cls.Method) is property + assert type(self.cls.Property) is property + def test_init(self): + o = self.cls() + assert read_only(o, 'Method') is None + assert read_only(o, 'Property') is None class test_Attribute(ClassChecker): @@ -350,7 +361,7 @@ class test_Attribute(ClassChecker): def test_finalize(self): user_obj = 'The user public.Object instance' class api(object): - obj = dict(user=user_obj) + Object = dict(user=user_obj) class user_add(self.cls): pass o = user_add() -- cgit