def int_decl(): tasks = Tasks(path='ecpy.tasks.tasks.logic') task = Task(task='loop_task:LoopTask', view='views.loop_view:LoopView') tasks.insert_children(None, [task]) i = Interface(interface='loop_iterable_interface:IterableLoopInterface', views=['views.loop_iterable_view:IterableLoopLabel']) task.insert_children(None, [i]) return task, i
def test_register_task_decl1(collector, task_decl): """Test registering the root task. """ parent = Tasks(group='test', path='ecpy.tasks') parent.insert_children(None, [task_decl]) task_decl.task = 'base_tasks:RootTask' task_decl.view = 'base_views:RootTaskView' parent.register(collector, {}) infos = collector.contributions['RootTask'] from ecpy.tasks.base_tasks import RootTask with enaml.imports(): from ecpy.tasks.base_views import RootTaskView assert infos.cls is RootTask assert infos.view is RootTaskView assert infos.metadata['group'] == 'test'
def test_register_task_decl1(collector, task_decl): """Test registering the root task. """ parent = Tasks(group='test', path='ecpy.tasks') parent.insert_children(None, [task_decl]) task_decl.task = 'base_tasks:RootTask' task_decl.view = 'base_views:RootTaskView' parent.register(collector, {}) infos = collector.contributions['ecpy.RootTask'] from ecpy.tasks.base_tasks import RootTask with enaml.imports(): from ecpy.tasks.base_views import RootTaskView assert infos.cls is RootTask assert infos.view is RootTaskView assert infos.metadata['group'] == 'test'