Skip to content

Commit

Permalink
Locate test data relative to test file
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jun 22, 2018
1 parent e382f1d commit da466be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/test_footprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# see <https://www.lsstcorp.org/LegalNotices/>.
#

import os
import unittest
import tempfile

Expand Down Expand Up @@ -247,7 +248,8 @@ def testPersistence(self):
del footprintFromFile

def testLegacyFootprints(self):
fileName = 'tests/data/preSpanSetsFootprint.fits'
testPath = os.path.abspath(os.path.dirname(__file__))
fileName = os.path.join(testPath, 'data', 'preSpanSetsFootprint.fits')
legacyFootprint = afwDet.Footprint.readFits(fileName)

# Calculate some quantifying numbers from the legacy Footprint to ensure
Expand Down
3 changes: 2 additions & 1 deletion tests/test_propertyListPersistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ def testFitsPersistence(self):
"""Test unpersisting from FITS"""

# Set up the LogicalLocation.
testPath = os.path.abspath(os.path.dirname(__file__))
logicalLocation = dafPers.LogicalLocation(
os.path.join("tests", "data", "HSC-0908120-056-small.fits"))
os.path.join(testPath, "data", "HSC-0908120-056-small.fits"))

# Create a FitsStorage and put it in a StorageList.
storage = self.persistence.getRetrieveStorage(
Expand Down

0 comments on commit da466be

Please sign in to comment.