Coverage for tests/test_runEotestTask.py: 68%

32 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-03-23 02:55 -0700

1#!/usr/bin/env python 

2 

3# 

4# LSST Data Management System 

5# 

6# Copyright 2008-2017 AURA/LSST. 

7# 

8# This product includes software developed by the 

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

10# 

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

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

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

14# (at your option) any later version. 

15# 

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

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

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

19# GNU General Public License for more details. 

20# 

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

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

23# see <https://www.lsstcorp.org/LegalNotices/>. 

24# 

25"""Test cases for cp_pipe.""" 

26 

27from __future__ import absolute_import, division, print_function 

28import unittest 

29 

30import lsst.utils 

31import lsst.utils.tests 

32 

33noEotestMsg = "" 

34noEotest = False 

35try: 

36 import lsst.eotest 

37except ImportError: 

38 noEotestMsg = "No eotest setup, so skipping unit test" 

39 noEotest = True 

40 

41 

42class RunEotestTaskTestCase(lsst.utils.tests.TestCase): 

43 """A test case for cp_pipe.""" 

44 

45 def testExample(self): 

46 pass 

47 

48 @unittest.skipIf(noEotest, noEotestMsg) 

49 def testImport(self): 

50 import lsst.cp.pipe as cpPipe # noqa: F401 

51 

52 @unittest.skipIf(noEotest, noEotestMsg) 

53 def testClassInstantiation(self): 

54 from lsst.cp.pipe.runEotestTask import RunEotestTask 

55 runEotestConfig = RunEotestTask.ConfigClass() 

56 runEotestConfig.eotestOutputPath = '/some/test/path' # must not be empty for validate() to pass 

57 runEotestTask = RunEotestTask(config=runEotestConfig) 

58 del runEotestTask 

59 

60 

61class TestMemory(lsst.utils.tests.MemoryTestCase): 

62 pass 

63 

64 

65def setup_module(module): 

66 lsst.utils.tests.init() 

67 

68 

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

70 lsst.utils.tests.init() 

71 unittest.main()