@@ -119,7 +119,7 @@ def test_successful_download(self, mock_requests, mock_load, mock_open, mock_mak
119119
120120
121121class TestWaitForStatus (SetUpGraphModule ):
122- @patch ("centml.compiler.config.settings.COMPILING_SLEEP_TIME " , new = 0 )
122+ @patch ("centml.compiler.config.settings.CENTML_COMPILER_SLEEP_TIME " , new = 0 )
123123 @patch ("centml.compiler.backend.requests" )
124124 @patch ("logging.Logger.exception" )
125125 def test_invalid_status (self , mock_logger , mock_requests ):
@@ -132,13 +132,13 @@ def test_invalid_status(self, mock_logger, mock_requests):
132132 self .runner ._wait_for_status (model_id )
133133
134134 mock_requests .get .assert_called ()
135- assert mock_requests .get .call_count == settings .MAX_RETRIES + 1
136- assert len (mock_logger .call_args_list ) == settings .MAX_RETRIES + 1
135+ assert mock_requests .get .call_count == settings .CENTML_COMPILER_MAX_RETRIES + 1
136+ assert len (mock_logger .call_args_list ) == settings .CENTML_COMPILER_MAX_RETRIES + 1
137137 print (mock_logger .call_args_list )
138138 assert mock_logger .call_args_list [0 ].startswith ("Status check failed:" )
139139 assert "Waiting for status: compilation failed too many times.\n " == str (context .exception )
140140
141- @patch ("centml.compiler.config.settings.COMPILING_SLEEP_TIME " , new = 0 )
141+ @patch ("centml.compiler.config.settings.CENTML_COMPILER_SLEEP_TIME " , new = 0 )
142142 @patch ("centml.compiler.backend.requests" )
143143 @patch ("logging.Logger.exception" )
144144 def test_exception_in_status (self , mock_logger , mock_requests ):
@@ -150,11 +150,11 @@ def test_exception_in_status(self, mock_logger, mock_requests):
150150 self .runner ._wait_for_status (model_id )
151151
152152 mock_requests .get .assert_called ()
153- assert mock_requests .get .call_count == settings .MAX_RETRIES + 1
153+ assert mock_requests .get .call_count == settings .CENTML_COMPILER_MAX_RETRIES + 1
154154 mock_logger .assert_called_with (f"Status check failed:\n { exception_message } " )
155155 assert str (context .exception ) == "Waiting for status: compilation failed too many times.\n "
156156
157- @patch ("centml.compiler.config.settings.COMPILING_SLEEP_TIME " , new = 0 )
157+ @patch ("centml.compiler.config.settings.CENTML_COMPILER_SLEEP_TIME " , new = 0 )
158158 @patch ("centml.compiler.backend.Runner._compile_model" )
159159 @patch ("centml.compiler.backend.requests" )
160160 def test_max_tries (self , mock_requests , mock_compile ):
@@ -167,10 +167,10 @@ def test_max_tries(self, mock_requests, mock_compile):
167167 with self .assertRaises (Exception ) as context :
168168 self .runner ._wait_for_status (model_id )
169169
170- self .assertEqual (mock_compile .call_count , settings .MAX_RETRIES + 1 )
170+ self .assertEqual (mock_compile .call_count , settings .CENTML_COMPILER_MAX_RETRIES + 1 )
171171 self .assertIn ("Waiting for status: compilation failed too many times" , str (context .exception ))
172172
173- @patch ("centml.compiler.config.settings.COMPILING_SLEEP_TIME " , new = 0 )
173+ @patch ("centml.compiler.config.settings.CENTML_COMPILER_SLEEP_TIME " , new = 0 )
174174 @patch ("centml.compiler.backend.requests" )
175175 def test_wait_on_compilation (self , mock_requests ):
176176 # Mock the status check
@@ -186,7 +186,7 @@ def test_wait_on_compilation(self, mock_requests):
186186 # _wait_for_status should return True when compilation DONE
187187 assert self .runner ._wait_for_status (model_id )
188188
189- @patch ("centml.compiler.config.settings.COMPILING_SLEEP_TIME " , new = 0 )
189+ @patch ("centml.compiler.config.settings.CENTML_COMPILER_SLEEP_TIME " , new = 0 )
190190 @patch ("centml.compiler.backend.requests" )
191191 @patch ("centml.compiler.backend.Runner._compile_model" )
192192 @patch ("logging.Logger.exception" )
@@ -206,10 +206,10 @@ def test_exception_in_compilation(self, mock_logger, mock_compile, mock_requests
206206 self .runner ._wait_for_status (model_id )
207207
208208 mock_requests .get .assert_called ()
209- assert mock_requests .get .call_count == settings .MAX_RETRIES + 1
209+ assert mock_requests .get .call_count == settings .CENTML_COMPILER_MAX_RETRIES + 1
210210
211211 mock_compile .assert_called ()
212- assert mock_compile .call_count == settings .MAX_RETRIES + 1
212+ assert mock_compile .call_count == settings .CENTML_COMPILER_MAX_RETRIES + 1
213213
214214 mock_logger .assert_called_with (f"Submitting compilation failed:\n { exception_message } " )
215215 assert str (context .exception ) == "Waiting for status: compilation failed too many times.\n "
0 commit comments