summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2010-02-10 21:15:47 -0700
committerRob Crittenden <rcritten@redhat.com>2010-02-11 14:56:10 -0500
commitdc2f246d478c948c180102d93d814f5bf5dbba89 (patch)
tree07e15515c447b6c7699f93aa66fe36fa5f0576c7 /tests/test_ipalib
parenta10dc1e59cab2444723541823d283cc121260775 (diff)
downloadfreeipa-dc2f246d478c948c180102d93d814f5bf5dbba89.tar.gz
freeipa-dc2f246d478c948c180102d93d814f5bf5dbba89.tar.xz
freeipa-dc2f246d478c948c180102d93d814f5bf5dbba89.zip
Command.output_params not contains params in Command.params
Diffstat (limited to 'tests/test_ipalib')
-rw-r--r--tests/test_ipalib/test_frontend.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_ipalib/test_frontend.py b/tests/test_ipalib/test_frontend.py
index b5ecd053a..7c67d6ccc 100644
--- a/tests/test_ipalib/test_frontend.py
+++ b/tests/test_ipalib/test_frontend.py
@@ -28,6 +28,7 @@ from ipalib.constants import TYPE_ERROR
from ipalib.base import NameSpace
from ipalib import frontend, backend, plugable, errors, parameters, config
from ipalib import output
+from ipalib.parameters import Str
def test_RULE_FLAG():
assert frontend.RULE_FLAG == 'validation_rule'
@@ -654,6 +655,32 @@ class test_Command(ClassChecker):
'nested', 'Subclass', 'world', 4, dict, tuple, nope
)
+ def test_get_output_params(self):
+ """
+ Test the `ipalib.frontend.Command.get_output_params` method.
+ """
+ class example(self.cls):
+ has_output_params = (
+ 'one',
+ 'two',
+ 'three',
+ )
+ takes_args = (
+ 'foo',
+ )
+ takes_options = (
+ Str('bar', flags='no_output'),
+ 'baz',
+ )
+
+ inst = example()
+ assert list(inst.get_output_params()) == ['one', 'two', 'three']
+ inst.finalize()
+ assert list(inst.get_output_params()) == [
+ 'one', 'two', 'three', inst.params.foo, inst.params.baz
+ ]
+ assert list(inst.output_params) == ['one', 'two', 'three', 'foo', 'baz']
+
class test_LocalOrRemote(ClassChecker):
"""