summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-09-09 21:18:44 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-09-09 21:18:44 +0000
commit97b01a48914fbed96b73fe8532bad3b4bd08027e (patch)
tree626268821b4522b4a729b109a6198e626b4757b2 /ipalib
parent21a0bab79ec9cddb98d6d3ab478ea48674eeda06 (diff)
downloadfreeipa-97b01a48914fbed96b73fe8532bad3b4bd08027e.tar.gz
freeipa-97b01a48914fbed96b73fe8532bad3b4bd08027e.tar.xz
freeipa-97b01a48914fbed96b73fe8532bad3b4bd08027e.zip
273: Added Command.get_args() method; added corresponding unit tests
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/public.py3
-rw-r--r--ipalib/tests/test_public.py11
2 files changed, 14 insertions, 0 deletions
diff --git a/ipalib/public.py b/ipalib/public.py
index 90b3b88ae..b22eff0e6 100644
--- a/ipalib/public.py
+++ b/ipalib/public.py
@@ -214,6 +214,9 @@ class Command(plugable.Plugin):
options = tuple()
takes_args = tuple()
+ def get_args(self):
+ return self.takes_args
+
def get_options(self):
return self.options
diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py
index 6cdfc5afb..f9ff3a892 100644
--- a/ipalib/tests/test_public.py
+++ b/ipalib/tests/test_public.py
@@ -357,6 +357,17 @@ class test_Command(ClassChecker):
assert self.cls.__bases__ == (plugable.Plugin,)
assert self.cls.options == tuple()
+ def test_get_args(self):
+ """
+ Tests the `public.Command.get_args` method.
+ """
+ assert list(self.cls().get_args()) == []
+ args = ('login', 'stuff')
+ class example(self.cls):
+ takes_args = args
+ o = example()
+ assert o.get_args() is args
+
def test_get_options(self):
"""
Tests the `public.Command.get_options` method.