@@ -647,40 +647,42 @@ def test_template(
647647
648648 if report is not None :
649649 try :
650- report = RegressionReport .parse_raw (report )
650+ the_report = RegressionReport .parse_raw (report )
651651 print ("testing regression report" )
652652 except Exception :
653- report = Report .parse_raw (report )
653+ the_report = Report .parse_raw (report )
654654 print ("testing normal report" )
655655
656656 if task_id is not None :
657657 task = self .onefuzz .tasks .get (task_id )
658- if report is None :
658+ if the_report is None :
659659 input_blob_ref = BlobRef (
660660 account = "dummy-storage-account" ,
661661 container = "test-notification-crashes" ,
662662 name = "fake-crash-sample" ,
663663 )
664- report = self ._create_report (
664+ the_report = self ._create_report (
665665 task .job_id , task .task_id , "fake_target.exe" , input_blob_ref
666666 )
667- elif isinstance (report , RegressionReport ):
668- report .crash_test_result .crash_report .task_id = task .task_id
669- report .crash_test_result .crash_report .job_id = task .job_id
667+ elif isinstance (the_report , RegressionReport ):
668+ if the_report .crash_test_result .crash_report is None :
669+ raise Exception ("invalid regression report: no crash report" )
670+ the_report .crash_test_result .crash_report .task_id = task .task_id
671+ the_report .crash_test_result .crash_report .job_id = task .job_id
670672 else :
671- report .task_id = task .task_id
672- report .job_id = task .job_id
673- elif report is None :
673+ the_report .task_id = task .task_id
674+ the_report .job_id = task .job_id
675+ elif the_report is None :
674676 raise Exception ("must specify either task_id or report" )
675677
676- report .report_url = "https://dummy-container.blob.core.windows.net/dummy-reports/dummy-report.json"
678+ the_report .report_url = "https://dummy-container.blob.core.windows.net/dummy-reports/dummy-report.json"
677679
678680 endpoint = Endpoint (self .onefuzz )
679681 return endpoint ._req_model (
680682 "POST" ,
681683 responses .NotificationTestResponse ,
682684 data = requests .NotificationTest (
683- report = report ,
685+ report = the_report ,
684686 notification = models .Notification (
685687 container = Container ("test-notification-reports" ),
686688 notification_id = uuid .uuid4 (),
0 commit comments