Hide keyboard shortcuts

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

1# 

2# LSST Data Management System 

3# Copyright 2008-2017 AURA/LSST. 

4# 

5# This product includes software developed by the 

6# LSST Project (http://www.lsst.org/). 

7# 

8# This program is free software: you can redistribute it and/or modify 

9# it under the terms of the GNU General Public License as published by 

10# the Free Software Foundation, either version 3 of the License, or 

11# (at your option) any later version. 

12# 

13# This program is distributed in the hope that it will be useful, 

14# but WITHOUT ANY WARRANTY; without even the implied warranty of 

15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

16# GNU General Public License for more details. 

17# 

18# You should have received a copy of the LSST License Statement and 

19# the GNU General Public License along with this program. If not, 

20# see <http://www.lsstcorp.org/LegalNotices/>. 

21# 

22 

23import os 

24import unittest 

25import lsst.utils.tests 

26 

27from lsst.pipe.tasks.ingest import IngestConfig 

28from lsst.pipe.tasks.makeSkyMap import MakeSkyMapConfig 

29from lsst.pipe.tasks.makeCoaddTempExp import MakeCoaddTempExpConfig 

30from lsst.pipe.tasks.multiBand import MergeDetectionsConfig 

31from lsst.pipe.tasks.multiBand import MergeMeasurementsConfig 

32from lsst.pipe.tasks.processCcd import ProcessCcdConfig 

33from lsst.utils import getPackageDir 

34 

35 

36class ConfigOverrideTestCase(lsst.utils.tests.TestCase): 

37 """Test that config overrides apply without error.""" 

38 CONFIG_DIR = os.path.join(getPackageDir("obs_cfht"), "config") 

39 

40 def testOverrides(self): 

41 # Other config overrides at time of writing: 

42 # 

43 # colorterms.py: Tested implicitly in processCcd.py 

44 # singleFrameDriver.py: Requires pipe_drivers, which is not a 

45 # dependency of this package. 

46 for configClass, overrideFilename in { 

47 IngestConfig: "ingest.py", 

48 MakeCoaddTempExpConfig: "makeCoaddTempExp.py", 

49 MakeSkyMapConfig: "makeSkyMap.py", 

50 MergeDetectionsConfig: "mergeCoaddDetections.py", 

51 MergeMeasurementsConfig: "mergeCoaddMeasurements.py", 

52 ProcessCcdConfig: "processCcd.py" 

53 }.items(): 

54 config = configClass() 

55 try: 

56 config.load(os.path.join(self.CONFIG_DIR, overrideFilename)) 

57 except AttributeError as e: 

58 # A failure to load configuration is a test failure, not an 

59 # error, so we convert the exception appropriately. 

60 self.fail(e) 

61 

62 

63def setup_module(module): 

64 lsst.utils.tests.init() 

65 

66 

67class MemoryTester(lsst.utils.tests.MemoryTestCase): 

68 pass 

69 

70 

71if __name__ == "__main__": 71 ↛ 72line 71 didn't jump to line 72, because the condition on line 71 was never true

72 lsst.utils.tests.init() 

73 unittest.main()