Skip to content

Commit 10e5f0c

Browse files
Merge branch 'main' into feature/mcp-server
2 parents dc9181a + 9ee6dd9 commit 10e5f0c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/test_cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ def test_get_api_key_claude(self):
2626
@patch.dict(os.environ, {}, clear=True)
2727
@patch('sys.stderr')
2828
def test_get_api_key_not_found(self, mock_stderr):
29+
# When no API key is set, falls back to Ollama local mode
2930
api_key = self.cli._get_api_key()
30-
self.assertIsNone(api_key)
31+
self.assertEqual(api_key, 'ollama-local')
3132

3233
@patch.dict(os.environ, {'OPENAI_API_KEY': 'sk-test-openai-key-123'})
3334
def test_get_provider_openai(self):
@@ -169,8 +170,9 @@ def test_install_unexpected_error(self, mock_interpreter_class):
169170

170171
@patch('sys.argv', ['cortex'])
171172
def test_main_no_command(self):
173+
# Running cortex with no command shows help and returns 0 (success)
172174
result = main()
173-
self.assertEqual(result, 1)
175+
self.assertEqual(result, 0)
174176

175177
@patch('sys.argv', ['cortex', 'install', 'docker'])
176178
@patch('cortex.cli.CortexCLI.install')

0 commit comments

Comments
 (0)