diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-10 22:23:22 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-10 22:23:22 +0000 |
commit | f6b69a590500cf8c141545a1f95d59817eb5a27e (patch) | |
tree | 48dc86bcb50f0e2fb66e859799d1e1818b694f83 /ipalib/tests/test_public.py | |
parent | d7958f3fde94d20be126f4486b8d906eb38446f7 (diff) | |
download | freeipa.git-f6b69a590500cf8c141545a1f95d59817eb5a27e.tar.gz freeipa.git-f6b69a590500cf8c141545a1f95d59817eb5a27e.tar.xz freeipa.git-f6b69a590500cf8c141545a1f95d59817eb5a27e.zip |
104: public.option now subclasses from plugable.Plugin; cleaned up unit tests for option
Diffstat (limited to 'ipalib/tests/test_public.py')
-rw-r--r-- | ipalib/tests/test_public.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py index 83fd65c1..68f25567 100644 --- a/ipalib/tests/test_public.py +++ b/ipalib/tests/test_public.py @@ -63,10 +63,10 @@ def test_is_rule(): assert not is_rule(call(None)) - - - class test_option(ClassChecker): + """ + Tests the option class. + """ _cls = public.option def get_subcls(self): @@ -91,10 +91,13 @@ class test_option(ClassChecker): """ Perform some tests on the class (not an instance). """ - #assert issubclass(cls, plugable.ReadOnly) + assert self.cls.__bases__ == (plugable.Plugin,) assert type(self.cls.rules) is property def test_normalize(self): + """ + Tests the `normalize` method. + """ assert 'normalize' in self.cls.__public__ o = self.subcls() # Test with values that can't be converted: @@ -125,7 +128,7 @@ class test_option(ClassChecker): def test_validate(self): """ - Test the validate method. + Tests the `validate` method. """ assert 'validate' in self.cls.__public__ o = self.subcls() @@ -137,7 +140,7 @@ class test_option(ClassChecker): def test_rules(self): """ - Test the rules property. + Tests the `rules` property. """ o = self.subcls() assert len(o.rules) == 3 @@ -147,13 +150,13 @@ class test_option(ClassChecker): assert o.rules == rules def test_default(self): + """ + Tests the `default` method. + """ assert 'default' in self.cls.__public__ assert self.cls().default() is None - - - def test_cmd(): cls = public.cmd assert issubclass(cls, plugable.Plugin) |