Skip to content

Commit d2ec206

Browse files
committed
fixes #42 package conflit resolution UI
1 parent 278056a commit d2ec206

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

.gitignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,6 @@ htmlcov/
153153
# ==============================
154154
# Cortex-specific
155155
# ==============================
156-
# User preferences and configuration
157-
.cortex/
158-
*.yaml.bak
159-
~/.config/cortex/preferences.yaml
160-
~/.config/cortex/*.backup.*
161-
/tmp/
162-
163156
# Data files (except contributors.json which is tracked)
164157
data/*.json
165158
data/*.csv

cortex/user_preferences.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ def validate(self) -> List[str]:
409409
if self._preferences.ai.model not in valid_models:
410410
errors.append(f"Unknown AI model: {self._preferences.ai.model}")
411411

412+
if self._preferences.ai.max_suggestions < 1:
413+
errors.append("ai.max_suggestions must be at least 1")
414+
412415
if self._preferences.auto_update.frequency_hours < 1:
413416
errors.append("auto_update.frequency_hours must be at least 1")
414417

test/test_conflict_ui.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,9 @@ def test_config_set_command(self, mock_stdout):
279279
value = self.cli.prefs_manager.get('ai.model')
280280
self.assertEqual(value, 'gpt-4')
281281

282+
@patch('builtins.input', return_value='y')
282283
@patch('sys.stdout', new_callable=StringIO)
283-
def test_config_reset_command(self, mock_stdout):
284+
def test_config_reset_command(self, mock_stdout, mock_input):
284285
"""Test resetting configuration to defaults."""
285286
# Set some preferences
286287
self.cli.prefs_manager.set('ai.model', 'custom-model')

0 commit comments

Comments
 (0)