Coverage for tests/test_lsstsw.py : 83%

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
# # LSST Data Management System # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # See COPYRIGHT file at the top of the source tree. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <https://www.lsstcorp.org/LegalNotices/>. #
except ImportError: mock = None
"""Tests for lsst.verify.provsrc.lsstsw.LsstswRepos.
These tests are tied to data in tests/data/lsstsw/ """
os.path.dirname(__file__), 'data', 'lsstsw')
lsstsw_repos.manifest_path, os.path.join(self.lsstsw_dirname, 'build', 'manifest.txt') )
lsstsw_repos.get_package_repo_path('afw'), os.path.join(self.lsstsw_dirname, 'build', 'afw') )
lsstsw_repos.get_package_repo_url('afw'), 'https://github.com/lsst/afw.git' )
lsstsw_repos.get_package_repo_url('xrootd'), 'https://github.com/lsst/xrootd.git' )
# FIXME not sure how to mock GitPython here. Actually complainst can't # lsstsw module. # @mock.patch('lsstsw.git.Repo') # @unittest.skipIf(mock is None, 'unittest.mock is required.') # def test_get_package_branch(self, MockRepo): # # mock git.Repo in lsst.verify.provsrc.lsstsw so that a repo's active # # branch is master and doesn't attempt to actually query the repo in # # the filesystem. # # mock.mocker.patch('lsstsw.verify.provsrc.lsstsw.git.Repo') # MockRepo.return_value.active_branch.name = 'master'
# lsstsw_repos = lsstsw.LsstswRepos(self.lsstsw_dirname) # self.assertEqual( # lsstsw_repos.get_package_branch('afw'), # 'master')
unittest.main() |