2011-10-20 06:23:14 +00:00
|
|
|
|
2018-07-17 09:28:59 +00:00
|
|
|
from cement.core.controller import ControllerInterface, ControllerHandler
|
2014-09-10 23:27:38 +00:00
|
|
|
|
|
|
|
|
|
2018-03-02 03:23:38 +00:00
|
|
|
# module tests
|
2011-10-20 06:23:14 +00:00
|
|
|
|
2018-07-17 09:28:59 +00:00
|
|
|
class TestControllerInterface(object):
|
2017-12-27 21:42:38 +00:00
|
|
|
def test_interface(self):
|
2018-07-17 09:28:59 +00:00
|
|
|
assert ControllerInterface.Meta.interface == 'controller'
|
2017-12-27 21:42:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestControllerHandler(object):
|
|
|
|
|
def test_subclassing(self):
|
|
|
|
|
class MyControllerHandler(ControllerHandler):
|
|
|
|
|
class Meta:
|
|
|
|
|
label = 'my_controller_handler'
|
|
|
|
|
|
|
|
|
|
def _dispatch(self, *args, **kw):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
h = MyControllerHandler()
|
|
|
|
|
assert h._meta.interface == 'controller'
|
|
|
|
|
assert h._meta.label == 'my_controller_handler'
|
|
|
|
|
|
2018-03-02 03:23:38 +00:00
|
|
|
# app functionality and coverage tests
|