Skip to content

Commit

Permalink
Fix diaForcedSource name. Add ppdb mock.
Browse files Browse the repository at this point in the history
  • Loading branch information
morriscb committed Jul 25, 2019
1 parent 7a46e07 commit 6b40729
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_appipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ def mockPatchSubtasks(self, task):
patch.object(task, "differencer") as mockDifferencer, \
patch.object(task, "diaSourceDpddifier") as mockDpddifier, \
patch.object(task, "associator") as mockAssociator, \
patch.object(task, "diaForcedSource") as mockForcedSource:
patch.object(task, "diaForcedSource") as mockForcedSource, \
patch.object(task, "ppdb") as mockPpdb:
yield pipeBase.Struct(ccdProcessor=mockCcdProcessor,
differencer=mockDifferencer,
dpddifier=mockDpddifier,
associator=mockAssociator,
forcedSource=mockForcedSource)
diaForcedSource=mockForcedSource,
ppdb=mockPpdb)

def testGenericRun(self):
"""Test the normal workflow of each ap_pipe step.
Expand All @@ -117,7 +119,7 @@ def testGenericRun(self):
subtasks.ccdProcessor.runDataRef.assert_called_once()
subtasks.differencer.runDataRef.assert_called_once()
subtasks.associator.run.assert_called_once()
subtasks.forcedSource.run.assert_called_once()
subtasks.diaForcedSource.run.assert_called_once()

def testReuseExistingOutput(self):
"""Test reuse keyword to ApPipeTask.runDataRef.
Expand Down Expand Up @@ -166,7 +168,7 @@ def testCalexpRun(self):
self.assertEqual(subtasks.ccdProcessor.runDataRef.call_count, 2)
subtasks.differencer.runDataRef.assert_called_once()
subtasks.associator.run.assert_called_once()
subtasks.forcedSource.run.assert_called_once()
subtasks.diaForcedSource.run.assert_called_once()


class MemoryTester(lsst.utils.tests.MemoryTestCase):
Expand Down

0 comments on commit 6b40729

Please sign in to comment.