def test_child_deletion_handling1(): # Test that adding a task to the root task is correctly handled. root = RootTask() task1 = ComplexTask(task_name='task1', task_database_entries={'val1': 2.0}) root.children_task.append(task1) root.children_task = []
def test_build_from_config1(self): # Test building a interfaceable task from a config. aux = RootTask() aux.children_task = [IMixin()] bis = RootTask.build_from_config(aux.task_preferences, {'tasks': {'IMixin': IMixin, 'RootTask': RootTask}}) assert_equal(type(bis.children_task[0]).__name__, 'IMixin')
def test_child_deletion_handling1(): # Test that adding a task to the root task is correctly handled. root = RootTask() task1 = ComplexTask(task_name='task1', task_database_entries={'val1': 2.0}) root.children_task.append(task1) root.children_task = []
def test_build_from_config1(self): # Test building a interfaceable task from a config. aux = RootTask() aux.children_task = [IMixin()] bis = RootTask.build_from_config( aux.task_preferences, {'tasks': { 'IMixin': IMixin, 'RootTask': RootTask }}) assert_equal(type(bis.children_task[0]).__name__, 'IMixin')
def test_collect_dependencies(self): # Test collecting build dependencies. self.workbench.register(TaskManagerManifest()) from hqc_meas.tasks.api import RootTask, ComplexTask from hqc_meas.tasks.tasks_util.log_task import LogTask aux = [LogTask(task_name="r")] root = RootTask(task_name="root") root.children_task = [ComplexTask(task_name="complex", children_task=aux), LogTask(task_name="t")] core = self.workbench.get_plugin(u"enaml.workbench.core") com = u"hqc_meas.dependencies.collect_dependencies" res, build, run = core.invoke_command(com, {"obj": root}, core) assert_true(res) assert_in("tasks", build) assert_equal(sorted(["LogTask", "ComplexTask"]), sorted(build["tasks"].keys())) assert_not_in("interfaces", build) assert_false(run)
def test_collect_dependencies(self): # Test collecting build dependencies. self.workbench.register(TaskManagerManifest()) from hqc_meas.tasks.api import RootTask, ComplexTask from hqc_meas.tasks.tasks_util.log_task import LogTask aux = [LogTask(task_name='r')] root = RootTask(task_name='root') root.children_task = [ ComplexTask(task_name='complex', children_task=aux), LogTask(task_name='t') ] core = self.workbench.get_plugin(u'enaml.workbench.core') com = u'hqc_meas.dependencies.collect_dependencies' res, build, run = core.invoke_command(com, {'obj': root}, core) assert_true(res) assert_in('tasks', build) assert_equal(sorted(['LogTask', 'ComplexTask']), sorted(build['tasks'].keys())) assert_not_in('interfaces', build) assert_false(run)