Coverage for tests/test_isrQa.py: 52%

23 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-01-06 02:29 -0800

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 <https://www.lsstcorp.org/LegalNotices/>. 

21# 

22 

23import unittest 

24import numpy as np 

25 

26import lsst.utils.tests 

27import lsst.ip.isr.isrQa as isrQa 

28import lsst.ip.isr.isrMock as isrMock 

29 

30 

31class IsrQaCases(lsst.utils.tests.TestCase): 

32 

33 def setUp(self): 

34 self.inputExp = isrMock.TrimmedRawMock().run() 

35 self.mi = self.inputExp.getMaskedImage() 

36 self.config = isrQa.IsrQaConfig() 

37 

38 def test_makeThumbnail(self): 

39 """Assert that thumbnails are made and contain non-zero data. 

40 """ 

41 thumb = isrQa.makeThumbnail(self.inputExp, self.config) 

42 self.assertTrue(np.nonzero(thumb)) 

43 

44 self.config.thumbnailSatBorder = 0 

45 thumb = isrQa.makeThumbnail(self.inputExp, self.config) 

46 

47 self.assertTrue(np.nonzero(thumb)) 

48 

49 

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

51 pass 

52 

53 

54def setup_module(module): 

55 lsst.utils.tests.init() 

56 

57 

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

59 lsst.utils.tests.init() 

60 unittest.main()