273: Added Command.get_args() method; added corresponding unit tests
This commit is contained in:
1 parent
21a0bab79e
commit
97b01a4891
2 files changed
+14
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user