@@ -195,13 +195,8 @@ def test_serve_default_options(cli_runner):
195195 # Use patches for run_servers and logging setup
196196 with (
197197 patch ("src.codegate.cli.run_servers" ) as mock_run ,
198- patch ("src.codegate.cli.OriginLogger" ) as mock_origin_logger ,
199198 patch ("src.codegate.cli.setup_logging" ) as mock_setup_logging ,
200199 ):
201-
202- logger_instance = MagicMock ()
203- mock_origin_logger .return_value = logger_instance
204-
205200 # Invoke the CLI command
206201 result = cli_runner .invoke (cli , ["serve" ])
207202
@@ -211,9 +206,6 @@ def test_serve_default_options(cli_runner):
211206 # Check if the logging setup was called with expected defaults
212207 mock_setup_logging .assert_called_once_with (LogLevel .INFO , LogFormat .JSON )
213208
214- # Check if logging was done correctly
215- mock_origin_logger .assert_called_with ("cli" )
216-
217209 # Validate run_servers was called once
218210 mock_run .assert_called_once ()
219211
@@ -222,13 +214,8 @@ def test_serve_custom_options(cli_runner):
222214 """Test serve command with custom options."""
223215 with (
224216 patch ("src.codegate.cli.run_servers" ) as mock_run ,
225- patch ("src.codegate.cli.OriginLogger" ) as mock_origin_logger ,
226217 patch ("src.codegate.cli.setup_logging" ) as mock_setup_logging ,
227218 ):
228-
229- logger_instance = MagicMock ()
230- mock_origin_logger .return_value = logger_instance
231-
232219 # Invoke the CLI command with custom options
233220 result = cli_runner .invoke (
234221 cli ,
@@ -261,9 +248,6 @@ def test_serve_custom_options(cli_runner):
261248 # Assert logging setup was called with the provided log level and format
262249 mock_setup_logging .assert_called_once_with (LogLevel .DEBUG , LogFormat .TEXT )
263250
264- # Assert logger got called with the expected module name
265- mock_origin_logger .assert_called_with ("cli" )
266-
267251 # Validate run_servers was called once
268252 mock_run .assert_called_once ()
269253 # Retrieve the actual Config object passed to run_servers
@@ -322,20 +306,14 @@ def test_serve_with_config_file(cli_runner, temp_config_file):
322306 """Test serve command with config file."""
323307 with (
324308 patch ("src.codegate.cli.run_servers" ) as mock_run ,
325- patch ("src.codegate.cli.OriginLogger" ) as mock_origin_logger ,
326309 patch ("src.codegate.cli.setup_logging" ) as mock_setup_logging ,
327310 ):
328-
329- logger_instance = MagicMock ()
330- mock_origin_logger .return_value = logger_instance
331-
332311 # Invoke the CLI command with the configuration file
333312 result = cli_runner .invoke (cli , ["serve" , "--config" , str (temp_config_file )])
334313
335314 # Assertions to ensure the CLI ran successfully
336315 assert result .exit_code == 0
337316 mock_setup_logging .assert_called_once_with (LogLevel .DEBUG , LogFormat .JSON )
338- mock_origin_logger .assert_called_with ("cli" )
339317
340318 # Validate that run_servers was called with the expected configuration
341319 mock_run .assert_called_once ()
@@ -370,13 +348,8 @@ def test_serve_priority_resolution(cli_runner: CliRunner, temp_config_file: Path
370348 with (
371349 patch .dict (os .environ , {"LOG_LEVEL" : "INFO" , "PORT" : "9999" }, clear = True ),
372350 patch ("src.codegate.cli.run_servers" ) as mock_run ,
373- patch ("src.codegate.cli.OriginLogger" ) as mock_origin_logger ,
374351 patch ("src.codegate.cli.setup_logging" ) as mock_setup_logging ,
375352 ):
376- # Set up mock logger
377- logger_instance = MagicMock ()
378- mock_origin_logger .return_value = logger_instance
379-
380353 # Execute CLI command with specific options overriding environment and config file settings
381354 result = cli_runner .invoke (
382355 cli ,
@@ -410,7 +383,6 @@ def test_serve_priority_resolution(cli_runner: CliRunner, temp_config_file: Path
410383
411384 # Ensure logging setup was called with the highest priority settings (CLI arguments)
412385 mock_setup_logging .assert_called_once_with ("ERROR" , "TEXT" )
413- mock_origin_logger .assert_called_with ("cli" )
414386
415387 # Verify that the run_servers was called with the overridden settings
416388 config_arg = mock_run .call_args [0 ][0 ] # Assuming Config is the first positional arg
@@ -438,13 +410,8 @@ def test_serve_certificate_options(cli_runner: CliRunner) -> None:
438410 """Test serve command with certificate options."""
439411 with (
440412 patch ("src.codegate.cli.run_servers" ) as mock_run ,
441- patch ("src.codegate.cli.OriginLogger" ) as mock_origin_logger ,
442413 patch ("src.codegate.cli.setup_logging" ) as mock_setup_logging ,
443414 ):
444- # Set up mock logger
445- logger_instance = MagicMock ()
446- mock_origin_logger .return_value = logger_instance
447-
448415 # Execute CLI command with certificate options
449416 result = cli_runner .invoke (
450417 cli ,
@@ -468,7 +435,6 @@ def test_serve_certificate_options(cli_runner: CliRunner) -> None:
468435
469436 # Ensure logging setup was called with expected arguments
470437 mock_setup_logging .assert_called_once_with ("INFO" , "JSON" )
471- mock_origin_logger .assert_called_with ("cli" )
472438
473439 # Verify that run_servers was called with the provided certificate options
474440 config_arg = mock_run .call_args [0 ][0 ] # Assuming Config is the first positional arg
0 commit comments