diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-22 21:50:53 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-22 21:50:53 +0000 |
commit | af52671e132818deaf266cd434338aff11064f01 (patch) | |
tree | c8fae0234063050f181f99c2154ea5f0d8ab6b5f /ipalib/tests/test_public.py | |
parent | f60fa06ce23d25042d258bdb7ae1b782993b1e42 (diff) | |
download | freeipa.git-af52671e132818deaf266cd434338aff11064f01.tar.gz freeipa.git-af52671e132818deaf266cd434338aff11064f01.tar.xz freeipa.git-af52671e132818deaf266cd434338aff11064f01.zip |
187: Renamed plubic.obj to Object; reworked plublic.Object unit tests to use ClassChecker
Diffstat (limited to 'ipalib/tests/test_public.py')
-rw-r--r-- | ipalib/tests/test_public.py | 19 |
1 files changed, 15 insertions, 4 deletions
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() |