Coverage for tests/test_findAstrometryNetDataDir.py : 37%

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
"""Locate the named Astrometry.net data directory from within the current tree, relative to this file, or relative to the supplied root directory.
Returns the located data directory and sets the ASTROMETRY_NET_DATA_DIR environment variable. """ if rootDir is None: rootDir = os.path.dirname(__file__) else: rootDir = os.path.abspath(rootDir) datapath = os.path.join(rootDir, 'astrometry_net_data', name) if not os.path.exists(datapath): raise ValueError("Need {} version of astrometry_net_data (from path: {})".format(name, datapath)) if verbose: print('Setting up astrometry_net_data: {}'.format(datapath)) os.environ["ASTROMETRY_NET_DATA_DIR"] = datapath return datapath
self.datapath = setupAstrometryNetDataDir('photocal')
self.assertEqual(os.environ["ASTROMETRY_NET_DATA_DIR"], self.datapath)
lsst.utils.tests.init()
lsst.utils.tests.init() unittest.main() |