@@ -138,30 +138,36 @@ def test_remove_main_project(app, app_config, config_manager):
138138 new_default_path = Path (new_default_dir )
139139
140140 # Ensure main exists
141- result = runner .invoke (cli_app , ["project" , "list" ], env = WIDE_TERMINAL_ENV )
141+ # Force local routing to keep this regression test independent from cloud auth/mode state.
142+ result = runner .invoke (cli_app , ["project" , "list" , "--local" ], env = WIDE_TERMINAL_ENV )
142143 if "main" not in result .stdout :
143- result = runner .invoke (cli_app , ["project" , "add" , "main" , str (main_path )])
144+ result = runner .invoke (cli_app , ["project" , "add" , "main" , str (main_path ), "--local" ])
144145 print (result .stdout )
145146 assert result .exit_code == 0
146147
147148 # Confirm main is present
148- result = runner .invoke (cli_app , ["project" , "list" ], env = WIDE_TERMINAL_ENV )
149+ result = runner .invoke (cli_app , ["project" , "list" , "--local" ], env = WIDE_TERMINAL_ENV )
149150 assert "main" in result .stdout
150151
151152 # Add a second project
152- result = runner .invoke (cli_app , ["project" , "add" , "new_default" , str (new_default_path )])
153+ result = runner .invoke (
154+ cli_app , ["project" , "add" , "new_default" , str (new_default_path ), "--local" ]
155+ )
153156 assert result .exit_code == 0
154157
155158 # Set new_default as default (if needed)
156- result = runner .invoke (cli_app , ["project" , "default" , "new_default" ])
159+ result = runner .invoke (cli_app , ["project" , "default" , "new_default" , "--local" ])
157160 assert result .exit_code == 0
158161
159162 # Remove main
160- result = runner .invoke (cli_app , ["project" , "remove" , "main" ])
163+ result = runner .invoke (cli_app , ["project" , "remove" , "main" , "--local" ])
164+ if result .exit_code != 0 :
165+ print (f"STDOUT: { result .stdout } " )
166+ print (f"STDERR: { result .stderr } " )
161167 assert result .exit_code == 0
162168
163169 # Confirm only new_default exists and main does not
164- result = runner .invoke (cli_app , ["project" , "list" ], env = WIDE_TERMINAL_ENV )
170+ result = runner .invoke (cli_app , ["project" , "list" , "--local" ], env = WIDE_TERMINAL_ENV )
165171 assert result .exit_code == 0
166172 assert "main" not in result .stdout
167173 assert "new_default" in result .stdout
0 commit comments