Coverage for tests/test_loading.py : 39%

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
# # LSST Data Management System # Copyright 2012-2016 LSST Corporation. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # 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 LSST License Statement and # the GNU General Public License along with this program. If not, # see <http://www.lsstcorp.org/LegalNotices/>. #
"""Testing loading of configuration files and repo."""
validateDrpDir = lsst.utils.getPackageDir('validate_drp') testDataDir = os.path.join(validateDrpDir, 'tests') self.configFile = os.path.join(testDataDir, 'runCfht.yaml') self.configFileNoDataIds = os.path.join(testDataDir, 'runCfhtParametersOnly.yaml')
pass
pbStruct = util.loadDataIdsAndParameters(self.configFile) self.assertAlmostEqual(pbStruct.brightSnr, 100)
pbStruct = util.loadDataIdsAndParameters(self.configFile) # Tests of the dict entries require constructing and comparing sets self.assertEqual(set(['r']), set([d['filter'] for d in pbStruct.dataIds])) self.assertEqual(set([849375, 850587]), set([d['visit'] for d in pbStruct.dataIds]))
pbStruct = util.loadDataIdsAndParameters(self.configFileNoDataIds) # Tests of the dict entries require constructing and comparing sets self.assertFalse(pbStruct.dataIds)
lsst.utils.tests.init()
lsst.utils.tests.init() unittest.main() |