mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-09 08:41:34 +00:00
Kanan/test template fix (#3308)
* Fix test_template logic * Rewrite test_template logic to make it's intention more clear
This commit is contained in:
parent
9bc1ab3c55
commit
06fb0d3fd0
@ -822,29 +822,26 @@ class DebugNotification(Command):
|
||||
) -> responses.NotificationTestResponse:
|
||||
"""Test a notification template"""
|
||||
|
||||
if task_id is None and report is None:
|
||||
raise Exception("must specify either task_id or report")
|
||||
|
||||
endpoint = Endpoint(self.onefuzz)
|
||||
if task_id is not None:
|
||||
task = self.onefuzz.tasks.get(task_id)
|
||||
if report is None:
|
||||
input_blob_ref = BlobRef(
|
||||
account="dummy-storage-account",
|
||||
container="test-notification-crashes",
|
||||
name="fake-crash-sample",
|
||||
)
|
||||
|
||||
if report is None:
|
||||
report = self._create_report(
|
||||
task.job_id, task.task_id, "fake_target.exe", input_blob_ref
|
||||
)
|
||||
|
||||
if task is not None:
|
||||
else:
|
||||
report.task_id = task.task_id
|
||||
report.job_id = task.job_id
|
||||
elif report is None:
|
||||
raise Exception("must specify either task_id or report")
|
||||
|
||||
report.report_url = "https://dummy-container.blob.core.windows.net/dummy-reports/dummy-report.json"
|
||||
|
||||
endpoint = Endpoint(self.onefuzz)
|
||||
return endpoint._req_model(
|
||||
"POST",
|
||||
responses.NotificationTestResponse,
|
||||
|
Loading…
x
Reference in New Issue
Block a user