@@ -221,7 +221,9 @@ async def test_store_submission_status_with_status_change(
221221
222222 # WHEN I update the status
223223 test_submission_status .status = "VALIDATED"
224- updated_status = await test_submission_status .store_async (synapse_client = self .syn )
224+ updated_status = await test_submission_status .store_async (
225+ synapse_client = self .syn
226+ )
225227
226228 # THEN the submission status should be updated
227229 assert updated_status .id == test_submission_status .id
@@ -239,7 +241,9 @@ async def test_store_submission_status_with_submission_annotations(
239241 "score" : 85.5 ,
240242 "feedback" : "Good work!" ,
241243 }
242- updated_status = await test_submission_status .store_async (synapse_client = self .syn )
244+ updated_status = await test_submission_status .store_async (
245+ synapse_client = self .syn
246+ )
243247
244248 # THEN the submission annotations should be saved
245249 assert updated_status .submission_annotations is not None
@@ -256,7 +260,9 @@ async def test_store_submission_status_with_legacy_annotations(
256260 "internal_score" : 92.3 ,
257261 "reviewer_notes" : "Excellent submission" ,
258262 }
259- updated_status = await test_submission_status .store_async (synapse_client = self .syn )
263+ updated_status = await test_submission_status .store_async (
264+ synapse_client = self .syn
265+ )
260266 assert updated_status .annotations is not None
261267
262268 converted_annotations = from_submission_status_annotations (
@@ -281,7 +287,9 @@ async def test_store_submission_status_with_combined_annotations(
281287 "internal_review" : True ,
282288 "notes" : "Needs minor improvements" ,
283289 }
284- updated_status = await test_submission_status .store_async (synapse_client = self .syn )
290+ updated_status = await test_submission_status .store_async (
291+ synapse_client = self .syn
292+ )
285293
286294 # THEN both types of annotations should be saved
287295 assert updated_status .submission_annotations is not None
@@ -307,7 +315,9 @@ async def test_store_submission_status_with_private_annotations_false(
307315 test_submission_status .private_status_annotations = False
308316
309317 # WHEN I store the submission status
310- updated_status = await test_submission_status .store_async (synapse_client = self .syn )
318+ updated_status = await test_submission_status .store_async (
319+ synapse_client = self .syn
320+ )
311321
312322 # THEN they should be properly stored
313323 assert updated_status .annotations is not None
@@ -340,7 +350,9 @@ async def test_store_submission_status_with_private_annotations_true(
340350 )
341351
342352 # WHEN I store the submission status
343- updated_status = await test_submission_status .store_async (synapse_client = self .syn )
353+ updated_status = await test_submission_status .store_async (
354+ synapse_client = self .syn
355+ )
344356
345357 # THEN they should be properly stored
346358 assert updated_status .annotations is not None
@@ -395,7 +407,9 @@ async def test_store_submission_status_change_tracking(
395407 assert test_submission_status .has_changed
396408
397409 # WHEN I store the changes
398- updated_status = await test_submission_status .store_async (synapse_client = self .syn )
410+ updated_status = await test_submission_status .store_async (
411+ synapse_client = self .syn
412+ )
399413
400414 # THEN has_changed should be False again
401415 assert not updated_status .has_changed
@@ -431,7 +445,9 @@ async def test_has_changed_property_edge_cases(
431445 assert test_submission_status .has_changed
432446
433447 # WHEN I store and get a fresh copy
434- updated_status = await test_submission_status .store_async (synapse_client = self .syn )
448+ updated_status = await test_submission_status .store_async (
449+ synapse_client = self .syn
450+ )
435451 fresh_status = await SubmissionStatus (id = updated_status .id ).get_async (
436452 synapse_client = self .syn
437453 )
@@ -510,7 +526,7 @@ async def test_files(
510526 finally :
511527 # Clean up the temporary file
512528 os .unlink (temp_file_path )
513-
529+
514530 return files
515531
516532 @pytest .fixture (scope = "function" )
@@ -611,7 +627,9 @@ async def test_batch_update_submission_statuses(
611627 # GIVEN multiple submission statuses
612628 statuses = []
613629 for submission in test_submissions :
614- status = await SubmissionStatus (id = submission .id ).get_async (synapse_client = self .syn )
630+ status = await SubmissionStatus (id = submission .id ).get_async (
631+ synapse_client = self .syn
632+ )
615633 # Update each status
616634 status .status = "VALIDATED"
617635 status .submission_annotations = {
@@ -717,33 +735,35 @@ async def test_submission(
717735 schedule_for_cleanup (created_submission .id )
718736 return created_submission
719737
720- async def test_submission_cancellation_workflow (
721- self , test_submission : Submission
722- ):
738+ async def test_submission_cancellation_workflow (self , test_submission : Submission ):
723739 """Test the complete submission cancellation workflow async."""
724740 # GIVEN a submission that exists
725741 submission_id = test_submission .id
726-
742+
727743 # WHEN I get the initial submission status
728- initial_status = await SubmissionStatus (id = submission_id ).get_async (synapse_client = self .syn )
729-
744+ initial_status = await SubmissionStatus (id = submission_id ).get_async (
745+ synapse_client = self .syn
746+ )
747+
730748 # THEN initially it should not be cancellable or cancelled
731749 assert initial_status .can_cancel is False
732750 assert initial_status .cancel_requested is False
733-
751+
734752 # WHEN I update the submission status to allow cancellation
735753 initial_status .can_cancel = True
736754 updated_status = await initial_status .store_async (synapse_client = self .syn )
737-
755+
738756 # THEN the submission should be marked as cancellable
739757 assert updated_status .can_cancel is True
740758 assert updated_status .cancel_requested is False
741-
759+
742760 # WHEN I cancel the submission
743761 await test_submission .cancel_async ()
744-
762+
745763 # THEN I should be able to retrieve the updated status showing cancellation was requested
746- final_status = await SubmissionStatus (id = submission_id ).get_async (synapse_client = self .syn )
764+ final_status = await SubmissionStatus (id = submission_id ).get_async (
765+ synapse_client = self .syn
766+ )
747767 assert final_status .can_cancel is True
748768 assert final_status .cancel_requested is True
749769
0 commit comments