Coverage for tests/test_eupsmanifest.py: 25%

24 statements  

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

1# This file is part of verify. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (https://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

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

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

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

12# (at your option) any later version. 

13# 

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

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

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

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the GNU General Public License 

20# along with this program. If not, see <https://www.gnu.org/licenses/>. 

21import os 

22import unittest 

23 

24from lsst.verify.metadata.eupsmanifest import Manifest 

25 

26 

27class ManifestTestCase(unittest.TestCase): 

28 """Test lsst.verify.provsrc.eupsmanifest.Manifest. 

29 

30 These tests are tied to data in tests/data/lsstsw/build/manifest.txt. 

31 """ 

32 

33 def setUp(self): 

34 self.manifest_path = os.path.join( 

35 os.path.dirname(__file__), 

36 'data', 'lsstsw', 'build', 'manifest.txt') 

37 

38 def test_manifest(self): 

39 with open(self.manifest_path) as f: 

40 manifest = Manifest(f) 

41 

42 self.assertEqual( 

43 len(manifest), 

44 132) 

45 

46 self.assertEqual(manifest.build, 'b1988') 

47 

48 self.assertIn('python', manifest) 

49 self.assertNotIn('ruby', manifest) 

50 

51 keys = [k for k in manifest] 

52 self.assertEqual(len(keys), len(manifest)) 

53 for key in keys: 

54 self.assertIn(key, manifest) 

55 

56 afw = manifest['afw'] 

57 self.assertEqual(afw.name, 'afw') 

58 self.assertEqual( 

59 afw.git_sha, 

60 'fc355a99abe3425003b0e5fbe1e13a39644b1e95') 

61 self.assertEqual( 

62 afw.version, 

63 '2.2016.10-22-gfc355a9') 

64 self.assertEqual( 

65 afw.dependencies, 

66 ['daf_base', 'daf_persistence', 'pex_config', 'ndarray', 

67 'cfitsio', 'wcslib', 'numpy', 'minuit2', 'eigen', 'gsl', 

68 'fftw', 'utils', 'astropy', 'pyfits', 'matplotlib', 'afwdata'] 

69 ) 

70 

71 

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

73 unittest.main()