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

DM-28668: PipelineTask unit test framework bypasses dimensions checks #78

Merged
merged 1 commit into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion tests/test_createApFakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def testRunQuantum(self):

quantum = testUtils.makeQuantum(
fakesTask, butler, dataId,
{key: dataId for key in {"skyMap", "fakeCat"}})
{"skyMap": {"skymap": dataId["skymap"]}, "fakeCat": dataId})
run = testUtils.runTestQuantum(fakesTask, butler, quantum, True)
# Actual input dataset omitted for simplicity
run.assert_called_once_with(tractId=dataId["tract"], skyMap=self.simpleMap)
Expand Down
35 changes: 20 additions & 15 deletions tests/test_matchApFakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ def testRunQuantum(self):
connections = matchTask.config.ConnectionsClass(
config=matchTask.config)

dataId = {"instrument": "notACam",
"skymap": "deepCoadd_skyMap",
"tract": 0,
"visit": 1234,
"detector": 25}
fakesDataId = {"skymap": "deepCoadd_skyMap",
"tract": 0}
imgDataId = {"instrument": "notACam",
"visit": 1234,
"detector": 25}
butlerTests.addDatasetType(
testRepo,
connections.fakeCat.name,
Expand All @@ -132,22 +132,27 @@ def testRunQuantum(self):

butler.put(self.fakeCat,
connections.fakeCat.name,
{"tract": dataId["tract"],
"skymap": dataId["skymap"]})
{"tract": fakesDataId["tract"],
"skymap": fakesDataId["skymap"]})
butler.put(self.exposure,
connections.diffIm.name,
{"instrument": dataId["instrument"],
"visit": dataId["visit"],
"detector": dataId["detector"]})
{"instrument": imgDataId["instrument"],
"visit": imgDataId["visit"],
"detector": imgDataId["detector"]})
butler.put(self.sourceCat,
connections.associatedDiaSources.name,
{"instrument": dataId["instrument"],
"visit": dataId["visit"],
"detector": dataId["detector"]})
{"instrument": imgDataId["instrument"],
"visit": imgDataId["visit"],
"detector": imgDataId["detector"]})

quantumDataId = imgDataId.copy()
quantumDataId.update(fakesDataId)
quantum = testUtils.makeQuantum(
matchTask, butler, dataId,
{key: dataId for key in {"fakeCat", "diffIm", "associatedDiaSources", "matchedDiaSources"}})
matchTask, butler, quantumDataId,
{"fakeCat": fakesDataId,
"diffIm": imgDataId,
"associatedDiaSources": imgDataId,
"matchedDiaSources": imgDataId})
run = testUtils.runTestQuantum(matchTask, butler, quantum)
# Actual input dataset omitted for simplicity
run.assert_called_once()
Expand Down