Coverage for tests/test_pipeline.py : 45%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# This file is part of pipe_base. # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (http://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
PipelineTaskConnections)
self.metadata.add("add", self.config.addend) return Struct( val=val + self.config.addend, )
self.metadata.add("mult", self.config.multiplicand) return Struct( val=val * self.config.multiplicand, )
"""A test case for Task """
pass
pass
"""Tests for TaskDef structure """ task1 = TaskDef("lsst.pipe.base.tests.Add", AddConfig()) self.assertEqual(task1.taskName, "lsst.pipe.base.tests.Add") self.assertIsInstance(task1.config, AddConfig) self.assertIsNone(task1.taskClass) self.assertEqual(task1.label, "")
task2 = TaskDef("lsst.pipe.base.tests.Mult", MultConfig(), MultTask, "mult_task") self.assertEqual(task2.taskName, "lsst.pipe.base.tests.Mult") self.assertIsInstance(task2.config, MultConfig) self.assertIs(task2.taskClass, MultTask) self.assertEqual(task2.label, "mult_task")
"""Creating empty pipeline """ pipeline = Pipeline("test") self.assertEqual(len(pipeline), 0)
"""Testing constructor with initial data """ pipeline = Pipeline("test") pipeline.addTask(AddTask, "add") pipeline.addTask(MultTask, "mult") self.assertEqual(len(pipeline), 2) expandedPipeline = list(pipeline.toExpandedPipeline()) self.assertEqual(expandedPipeline[0].taskName, "AddTask") self.assertEqual(expandedPipeline[1].taskName, "MultTask")
pipeline = Pipeline("test") pipeline.addTask(AddTask, "add") pipeline.addTask(MultTask, "mult") dump = str(pipeline) load = Pipeline.fromString(dump) self.assertEqual(pipeline, load)
lsst.utils.tests.init()
lsst.utils.tests.init() unittest.main() |