Skip to content

Commit

Permalink
Add test for _doIngest(..., badFiles).
Browse files Browse the repository at this point in the history
  • Loading branch information
kfindeisen committed May 30, 2018
1 parent b04da35 commit 1fa5d53
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,19 @@ def testNoFileIngest(self):
butler = self._calibButler()
self.assertTrue(_isEmpty(butler, 'raw'))

# TODO: add unit test for _doIngest(..., badFiles) once DM-13835 resolved
def testBadFileIngest(self):
"""Test that ingestion of raw data ignores blacklisted files.
"""
badFiles = ['raw_v2_fg.fits.gz']

testDir = os.path.join(IngestionTestSuite.testData, 'raw')
files = [os.path.join(testDir, datum['file']) for datum in IngestionTestSuite.rawData]
self._task._doIngest(self._repo, files, badFiles)

butler = self._rawButler()
for datum in IngestionTestSuite.rawData:
dataId = {'visit': datum['visit']}
self.assertEqual(butler.datasetExists('raw', dataId), datum['file'] not in badFiles)

def testFindMatchingFiles(self):
"""Test that _findMatchingFiles finds the desired files.
Expand Down

0 comments on commit 1fa5d53

Please sign in to comment.