summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.