summaryrefslogtreecommitdiffstats
path: root/ipalib/tests/test_public.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-08-26 19:13:55 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-08-26 19:13:55 +0000
commit845c0d8bc6bbd05a871d7b002415f83ab745cbd2 (patch)
treeb7e4bc55eda513645458a35d96bb1a0681c971c5 /ipalib/tests/test_public.py
parent0e47948695680047490ebdc55ca3fa4f7347640f (diff)
downloadfreeipa.git-845c0d8bc6bbd05a871d7b002415f83ab745cbd2.tar.gz
freeipa.git-845c0d8bc6bbd05a871d7b002415f83ab745cbd2.tar.xz
freeipa.git-845c0d8bc6bbd05a871d7b002415f83ab745cbd2.zip
198: Renamed Command.default() to Command.get_default(); Command.get_default_iter() now correctly calls Option.get_default() instead of Option.default()
Diffstat (limited to 'ipalib/tests/test_public.py')
-rw-r--r--ipalib/tests/test_public.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py
index 609ac33e..3ed1f5da 100644
--- a/ipalib/tests/test_public.py
+++ b/ipalib/tests/test_public.py
@@ -210,7 +210,6 @@ class test_Option(ClassChecker):
assert o.get_default(key0=7) == 3
-
class test_Command(ClassChecker):
"""
Tests the `public.Command` class.
@@ -225,8 +224,9 @@ class test_Command(ClassChecker):
def my_rule(self, value):
if value != self.name:
return 'must equal %r' % self.name
- def default(self, **kw):
- return kw['default_from']
+ default_from = public.DefaultFrom(
+ lambda arg: arg, 'default_from'
+ )
class option0(my_option):
pass
@@ -282,11 +282,11 @@ class test_Command(ClassChecker):
sub = self.subcls()
assert sub.normalize(**kw) == norm
- def test_default(self):
+ def test_get_default(self):
"""
- Tests the `public.Command.default` method.
+ Tests the `public.Command.get_default` method.
"""
- assert 'default' in self.cls.__public__ # Public
+ assert 'get_default' in self.cls.__public__ # Public
no_fill = dict(
option0='value0',
option1='value1',
@@ -300,8 +300,8 @@ class test_Command(ClassChecker):
option1='the default',
)
sub = self.subcls()
- assert sub.default(**no_fill) == {}
- assert sub.default(**fill) == default
+ assert sub.get_default(**no_fill) == {}
+ assert sub.get_default(**fill) == default
def test_validate(self):
"""