Skip to content

Commit

Permalink
Add test for arbitrary ref name
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Krughoff committed Jan 20, 2017
1 parent e8ec3f9 commit ab0beec
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testHtmIndex.py
Expand Up @@ -144,7 +144,10 @@ def setUpClass(cls):
config.mag_err_column_map = {'a': 'a_err', 'b': 'b_err'}
IngestIndexedReferenceTask.parseAndRun(args=[input_dir, "--output", cls.test_repo_path,
cls.sky_catalog_file], config=config)
cls.default_dataset_name = config.dataset_config.ref_dataset_name
cls.test_butler = dafPersist.Butler(cls.test_repo_path)
os.symlink(os.path.join(cls.test_repo_path, 'ref_cats', cls.default_dataset_name),
os.path.join(cls.test_repo_path, 'ref_cats', 'diff_ref_name'))

@classmethod
def tearDownClass(cls):
Expand Down Expand Up @@ -239,6 +242,16 @@ def testIngest(self):
cent = make_coord(*tupl)
cat = loader.loadSkyCircle(cent, self.search_radius, filterName='a')
self.assertTrue(len(cat) > 0)
# test that a catalog can be loaded even with a name not used for ingestion
butler = dafPersist.Butler(self.test_repo_path)
config = LoadIndexedReferenceObjectsConfig()
config.ref_dataset_name = "diff_ref_name"
loader = LoadIndexedReferenceObjectsTask(butler=butler, config=config)
# This location is known to have objects
tupl = (93.0, -90.0)
cent = make_coord(*tupl)
cat = loader.loadSkyCircle(cent, self.search_radius, filterName='a')
self.assertTrue(len(cat) > 0)

def testLoadIndexedReferenceConfig(self):
"""Make sure LoadIndexedReferenceConfig has needed fields."""
Expand Down

0 comments on commit ab0beec

Please sign in to comment.