@@ -26,7 +26,7 @@ def test_llm_command_without_args(mock_llm, executor):
2626 assert mock_llm is not None
2727 test_text = r"\llm"
2828 with pytest .raises (FinishIteration ) as exc_info :
29- handle_llm (test_text , executor )
29+ handle_llm (test_text , executor , 'mysql' )
3030 # Should return usage message when no args provided
3131 assert exc_info .value .args [0 ] == [(None , None , None , USAGE )]
3232
@@ -38,7 +38,7 @@ def test_llm_command_with_c_flag(mock_run_cmd, mock_llm, executor):
3838 mock_run_cmd .return_value = (0 , "Hello, no SQL today." )
3939 test_text = r"\llm -c 'Something?'"
4040 with pytest .raises (FinishIteration ) as exc_info :
41- handle_llm (test_text , executor )
41+ handle_llm (test_text , executor , 'mysql' )
4242 # Expect raw output when no SQL fence found
4343 assert exc_info .value .args [0 ] == [(None , None , None , "Hello, no SQL today." )]
4444
@@ -51,7 +51,7 @@ def test_llm_command_with_c_flag_and_fenced_sql(mock_run_cmd, mock_llm, executor
5151 fenced = f"Here you go:\n ```sql\n { sql_text } \n ```"
5252 mock_run_cmd .return_value = (0 , fenced )
5353 test_text = r"\llm -c 'Rewrite SQL'"
54- result , sql , duration = handle_llm (test_text , executor )
54+ result , sql , duration = handle_llm (test_text , executor , 'mysql' )
5555 # Without verbose, result is empty, sql extracted
5656 assert sql == sql_text
5757 assert result == ""
@@ -64,7 +64,7 @@ def test_llm_command_known_subcommand(mock_run_cmd, mock_llm, executor):
6464 # 'models' is a known subcommand
6565 test_text = r"\llm models"
6666 with pytest .raises (FinishIteration ) as exc_info :
67- handle_llm (test_text , executor )
67+ handle_llm (test_text , executor , 'mysql' )
6868 mock_run_cmd .assert_called_once_with ("llm" , "models" , restart_cli = False )
6969 assert exc_info .value .args [0 ] is None
7070
@@ -74,7 +74,7 @@ def test_llm_command_known_subcommand(mock_run_cmd, mock_llm, executor):
7474def test_llm_command_with_help_flag (mock_run_cmd , mock_llm , executor ):
7575 test_text = r"\llm --help"
7676 with pytest .raises (FinishIteration ) as exc_info :
77- handle_llm (test_text , executor )
77+ handle_llm (test_text , executor , 'mysql' )
7878 mock_run_cmd .assert_called_once_with ("llm" , "--help" , restart_cli = False )
7979 assert exc_info .value .args [0 ] is None
8080
@@ -84,7 +84,7 @@ def test_llm_command_with_help_flag(mock_run_cmd, mock_llm, executor):
8484def test_llm_command_with_install_flag (mock_run_cmd , mock_llm , executor ):
8585 test_text = r"\llm install openai"
8686 with pytest .raises (FinishIteration ) as exc_info :
87- handle_llm (test_text , executor )
87+ handle_llm (test_text , executor , 'mysql' )
8888 mock_run_cmd .assert_called_once_with ("llm" , "install" , "openai" , restart_cli = True )
8989 assert exc_info .value .args [0 ] is None
9090
@@ -98,7 +98,7 @@ def test_llm_command_with_prompt(mock_sql_using_llm, mock_ensure_template, mock_
9898 """
9999 mock_sql_using_llm .return_value = ("CTX" , "SELECT 1;" )
100100 test_text = r"\llm prompt 'Test?'"
101- context , sql , duration = handle_llm (test_text , executor )
101+ context , sql , duration = handle_llm (test_text , executor , 'mysql' )
102102 mock_ensure_template .assert_called_once ()
103103 mock_sql_using_llm .assert_called ()
104104 assert context == "CTX"
@@ -115,7 +115,7 @@ def test_llm_command_question_with_context(mock_sql_using_llm, mock_ensure_templ
115115 """
116116 mock_sql_using_llm .return_value = ("CTX2" , "SELECT 2;" )
117117 test_text = r"\llm 'Top 10?'"
118- context , sql , duration = handle_llm (test_text , executor )
118+ context , sql , duration = handle_llm (test_text , executor , 'mysql' )
119119 mock_ensure_template .assert_called_once ()
120120 mock_sql_using_llm .assert_called ()
121121 assert context == "CTX2"
@@ -132,7 +132,7 @@ def test_llm_command_question_verbose(mock_sql_using_llm, mock_ensure_template,
132132 """
133133 mock_sql_using_llm .return_value = ("NO_CTX" , "SELECT 42;" )
134134 test_text = r"\llm- 'Succinct?'"
135- context , sql , duration = handle_llm (test_text , executor )
135+ context , sql , duration = handle_llm (test_text , executor , 'mysql' )
136136 assert context == ""
137137 assert sql == "SELECT 42;"
138138 assert isinstance (duration , float )
@@ -194,5 +194,5 @@ def test_handle_llm_aliases_without_args(prefix, executor, monkeypatch):
194194
195195 monkeypatch .setattr (llm_module , "llm" , object ())
196196 with pytest .raises (FinishIteration ) as exc_info :
197- handle_llm (prefix , executor )
197+ handle_llm (prefix , executor , 'mysql' )
198198 assert exc_info .value .args [0 ] == [(None , None , None , USAGE )]
0 commit comments