2017-12-27 21:42:38 +00:00
|
|
|
|
2018-07-17 09:28:59 +00:00
|
|
|
from cement.core.arg import ArgumentInterface, ArgumentHandler
|
2017-12-27 21:42:38 +00:00
|
|
|
|
|
|
|
|
|
2018-03-02 03:23:38 +00:00
|
|
|
# module tests
|
2017-12-27 21:42:38 +00:00
|
|
|
|
2018-07-17 09:28:59 +00:00
|
|
|
class TestArgumentInterface(object):
|
2017-12-27 21:42:38 +00:00
|
|
|
def test_interface(self):
|
2018-07-17 09:28:59 +00:00
|
|
|
assert ArgumentInterface.Meta.interface == 'argument'
|
2017-12-27 21:42:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestArgumentHandler(object):
|
|
|
|
|
def test_subclassing(self):
|
|
|
|
|
class MyArgumentHandler(ArgumentHandler):
|
|
|
|
|
class Meta:
|
|
|
|
|
label = 'my_argument_handler'
|
|
|
|
|
|
|
|
|
|
def add_argument(self, *args, **kw):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def parse(self, *args, **kw):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
h = MyArgumentHandler()
|
|
|
|
|
assert h._meta.interface == 'argument'
|
|
|
|
|
assert h._meta.label == 'my_argument_handler'
|
|
|
|
|
|
|
|
|
|
|
2018-03-02 03:23:38 +00:00
|
|
|
# app functionality and coverage tests
|