1111class TestRerunProcessor :
1212 """Test rerun processing functionality"""
1313
14+ @patch .dict ("os.environ" , {"AWS_DEFAULT_REGION" : "us-east-1" })
1415 @patch ("idp_cli.stack_info.StackInfo" )
1516 @patch ("boto3.client" )
17+ @patch .dict ("os.environ" , {"AWS_DEFAULT_REGION" : "us-east-1" })
1618 def test_init_success (self , mock_boto_client , mock_stack_info_class ):
1719 """Test successful initialization"""
1820 from idp_cli .rerun_processor import RerunProcessor
@@ -31,8 +33,10 @@ def test_init_success(self, mock_boto_client, mock_stack_info_class):
3133 assert processor .stack_name == "test-stack"
3234 assert processor .resources ["DocumentQueue" ] is not None
3335
36+ @patch .dict ("os.environ" , {"AWS_DEFAULT_REGION" : "us-east-1" })
3437 @patch ("idp_cli.stack_info.StackInfo" )
3538 @patch ("boto3.client" )
39+ @patch .dict ("os.environ" , {"AWS_DEFAULT_REGION" : "us-east-1" })
3640 def test_prepare_for_classification_rerun (
3741 self , mock_boto_client , mock_stack_info_class
3842 ):
@@ -85,6 +89,7 @@ def test_prepare_for_classification_rerun(
8589 assert result .status == Status .QUEUED
8690 assert result .start_time is None
8791
92+ @patch .dict ("os.environ" , {"AWS_DEFAULT_REGION" : "us-east-1" })
8893 @patch ("idp_cli.stack_info.StackInfo" )
8994 @patch ("boto3.client" )
9095 def test_prepare_for_extraction_rerun (
@@ -141,6 +146,7 @@ def test_prepare_for_extraction_rerun(
141146 # Verify status reset
142147 assert result .status == Status .QUEUED
143148
149+ @patch .dict ("os.environ" , {"AWS_DEFAULT_REGION" : "us-east-1" })
144150 @patch ("idp_cli.stack_info.StackInfo" )
145151 @patch ("boto3.client" )
146152 def test_send_to_queue (self , mock_boto_client , mock_stack_info_class ):
@@ -176,6 +182,7 @@ def test_send_to_queue(self, mock_boto_client, mock_stack_info_class):
176182 )
177183 assert "test-doc" in call_args [1 ]["MessageBody" ]
178184
185+ @patch .dict ("os.environ" , {"AWS_DEFAULT_REGION" : "us-east-1" })
179186 @patch ("idp_cli.stack_info.StackInfo" )
180187 @patch ("idp_cli.rerun_processor.RerunProcessor._get_document" )
181188 @patch ("idp_cli.rerun_processor.RerunProcessor._send_to_queue" )
@@ -225,6 +232,7 @@ def test_rerun_documents_classification(
225232 # Verify send_to_queue was called
226233 mock_send_to_queue .assert_called_once ()
227234
235+ @patch .dict ("os.environ" , {"AWS_DEFAULT_REGION" : "us-east-1" })
228236 @patch ("idp_cli.stack_info.StackInfo" )
229237 @patch ("idp_cli.rerun_processor.RerunProcessor._get_document" )
230238 @patch ("boto3.client" )
@@ -257,6 +265,7 @@ def test_rerun_documents_document_not_found(
257265 assert len (results ["failed_documents" ]) == 1
258266 assert results ["failed_documents" ][0 ]["object_key" ] == "missing-doc"
259267
268+ @patch .dict ("os.environ" , {"AWS_DEFAULT_REGION" : "us-east-1" })
260269 @patch ("idp_cli.stack_info.StackInfo" )
261270 @patch ("idp_cli.batch_processor.BatchProcessor" )
262271 @patch ("boto3.client" )
0 commit comments