Coverage for tests/test_getPackageDir.py: 57%
22 statements
« prev ^ index » next coverage.py v6.5.0, created at 2023-02-04 02:34 -0800
« prev ^ index » next coverage.py v6.5.0, created at 2023-02-04 02:34 -0800
1# This file is part of utils.
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# Use of this source code is governed by a 3-clause BSD-style
10# license that can be found in the LICENSE file.
12import os
13import sys
14import unittest
16import lsst.utils.tests
17from lsst.utils import getPackageDir
20@unittest.skipIf("UTILS_DIR" not in os.environ, "EUPS has not set up this package.")
21class GetPackageDirTestCase(unittest.TestCase):
22 def testBasics(self):
23 utilsPath = getPackageDir("utils")
24 self.assertTrue(os.path.isfile(os.path.join(utilsPath, "tests", "test_getPackageDir.py")))
26 # Confirm that we have a correct Python exception and pex exception
27 with self.assertRaises(LookupError):
28 getPackageDir("nameOfNonexistendPackage2234q?#!")
30 def testUnicodeBasics(self):
31 utilsPath = getPackageDir("utils")
32 self.assertTrue(os.path.isfile(os.path.join(utilsPath, "tests", "test_getPackageDir.py")))
35class TestMemory(lsst.utils.tests.MemoryTestCase):
36 pass
39def setup_module(module):
40 lsst.utils.tests.init()
43if __name__ == "__main__": 43 ↛ 44line 43 didn't jump to line 44, because the condition on line 43 was never true
44 setup_module(sys.modules[__name__])
45 unittest.main()