@@ -684,6 +684,59 @@ def test_build_review_pipeline_context_defaults_to_candidate_based_claim(self) -
684684 self .assertEqual (result ["status" ], "ready" )
685685 self .assertEqual (result ["selection" ]["pr_number" ], 570 )
686686
687+ def test_build_review_pipeline_context_explicit_pr_defaults_to_candidate_based_claim (
688+ self ,
689+ ) -> None :
690+ with mock .patch .object (
691+ pipeline_skill_context .pipeline_board ,
692+ "claim_entry_from_entries" ,
693+ return_value = {
694+ "item_id" : "PVTI_11" ,
695+ "number" : 570 ,
696+ "issue_number" : 117 ,
697+ "pr_number" : 570 ,
698+ "status" : "Review pool" ,
699+ "title" : "[Model] GraphPartitioning" ,
700+ "claimed" : True ,
701+ "claimed_status" : "Under review" ,
702+ },
703+ ) as claim_from_entries :
704+ result = pipeline_skill_context .build_review_pipeline_context (
705+ repo = "CodingThrust/problem-reductions" ,
706+ pr_number = 570 ,
707+ state_file = Path ("/tmp/problemreductions-review-state.json" ),
708+ review_candidate_fetcher = lambda repo : [
709+ {
710+ "item_id" : "PVTI_11" ,
711+ "issue_number" : 117 ,
712+ "pr_number" : 570 ,
713+ "status" : "Review pool" ,
714+ "title" : "[Model] GraphPartitioning" ,
715+ "eligibility" : "eligible" ,
716+ "reason" : "copilot reviewed" ,
717+ }
718+ ],
719+ pr_context_builder = lambda repo , pr_number : {"number" : pr_number },
720+ review_preparer = lambda repo , pr_number : {"ready" : True },
721+ )
722+
723+ claim_from_entries .assert_called_once_with (
724+ "review" ,
725+ {
726+ "PVTI_11" : {
727+ "number" : 570 ,
728+ "issue_number" : 117 ,
729+ "pr_number" : 570 ,
730+ "status" : "Review pool" ,
731+ "title" : "[Model] GraphPartitioning" ,
732+ }
733+ },
734+ Path ("/tmp/problemreductions-review-state.json" ),
735+ target_number = 570 ,
736+ )
737+ self .assertEqual (result ["status" ], "ready" )
738+ self .assertEqual (result ["selection" ]["pr_number" ], 570 )
739+
687740 def test_build_final_review_context_reports_empty_queue (self ) -> None :
688741 result = pipeline_skill_context .build_final_review_context (
689742 repo = "CodingThrust/problem-reductions" ,
0 commit comments