Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickets/DM-11691 Test failure with butler in obs_sdss #36

Merged
merged 1 commit into from
Aug 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/testGetId.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,29 @@
# see <https://www.lsstcorp.org/LegalNotices/>.
#

import os
import shutil
import tempfile
import unittest
import lsst.utils.tests

import lsst.daf.persistence as dafPersist
from lsst.obs.sdss import SdssMapper

ROOT = os.path.abspath(os.path.dirname(__file__))


class GetIdTestCase(lsst.utils.tests.TestCase):
"""Testing butler exposure id retrieval"""

def setUp(self):
self.bf = dafPersist.ButlerFactory(mapper=SdssMapper(root="."))
self.butler = self.bf.create()
self.testDir = tempfile.mkdtemp(dir=ROOT, prefix='GetIdTestCase-')
self.butler = dafPersist.Butler(
outputs={'root': self.testDir, 'mode': 'rw', 'mapper': 'lsst.obs.sdss.SdssMapper'})

def tearDown(self):
del self.butler
del self.bf
if os.path.exists(self.testDir):
shutil.rmtree(self.testDir)

def testId(self):
"""Test retrieval of exposure ids"""
Expand All @@ -65,6 +71,7 @@ class TestMemory(lsst.utils.tests.MemoryTestCase):
def setup_module(module):
lsst.utils.tests.init()


if __name__ == "__main__":
lsst.utils.tests.init()
unittest.main()