summaryrefslogtreecommitdiffstats
path: root/ipalib/tests
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-08-08 04:47:42 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-08-08 04:47:42 +0000
commit9ee10d383dc03649c3358ab7a296872fac528ada (patch)
treed59118921deb0bd61761b4c32b88d9049c864a54 /ipalib/tests
parent62dc9a78fd919193a53d4490e6ac03ec889efa3c (diff)
downloadfreeipa.git-9ee10d383dc03649c3358ab7a296872fac528ada.tar.gz
freeipa.git-9ee10d383dc03649c3358ab7a296872fac528ada.tar.xz
freeipa.git-9ee10d383dc03649c3358ab7a296872fac528ada.zip
78: Renamed opt to option; started fleshing out cmd more
Diffstat (limited to 'ipalib/tests')
-rw-r--r--ipalib/tests/test_public.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py
index 57cb2a77..3ef7ad08 100644
--- a/ipalib/tests/test_public.py
+++ b/ipalib/tests/test_public.py
@@ -63,9 +63,9 @@ def test_is_rule():
assert not is_rule(call(None))
-class test_opt():
+class test_option():
def cls(self):
- return public.opt
+ return public.option
def sub(self):
rule = public.rule
@@ -85,11 +85,20 @@ class test_opt():
return 'cannot be 2'
return int_opt
+ def test_class(self):
+ """
+ Perform some tests on the class (not an instance).
+ """
+ cls = self.cls()
+ #assert issubclass(cls, plugable.ReadOnly)
+ assert type(cls.rules) is property
+
def test_rules(self):
"""
Test the rules property.
"""
o = self.sub()()
+ assert len(o.rules) == 3
def get_rule(i):
return getattr(o, 'rule_%d' % i)
rules = tuple(get_rule(i) for i in xrange(3))
@@ -105,14 +114,6 @@ class test_opt():
e = raises(errors.RuleError, o.validate, i)
assert e.error == 'cannot be %d' % i
-
-
-
-
- def test_class(self):
- cls = self.cls()
- assert issubclass(cls, plugable.ReadOnly)
-
def test_normalize(self):
sub = self.sub()