|
5 | 5 |
|
6 | 6 | import os |
7 | 7 | import sys |
8 | | -import unittest |
9 | | -from unittest.mock import patch, MagicMock, call |
| 8 | +from unittest import TestCase, mock |
| 9 | +from unittest.mock import MagicMock, call, patch |
10 | 10 |
|
11 | 11 | # Import pytest only if available |
12 | 12 | try: |
@@ -35,8 +35,12 @@ def decorator(f): |
35 | 35 | try: |
36 | 36 | from cli_code.config import Config |
37 | 37 | from cli_code.main import ( |
38 | | - cli, set_default_provider, set_default_model, list_models, |
39 | | - setup_command, start_interactive_session |
| 38 | + cli, |
| 39 | + list_models, |
| 40 | + set_default_model, |
| 41 | + set_default_provider, |
| 42 | + setup_command, |
| 43 | + start_interactive_session, |
40 | 44 | ) |
41 | 45 | # Import click testing if available |
42 | 46 | try: |
@@ -69,7 +73,7 @@ def start_interactive_session(): pass |
69 | 73 | ) |
70 | 74 |
|
71 | 75 | @skip_if_imports_unavailable |
72 | | -class TestMainCLICommands(unittest.TestCase): |
| 76 | +class TestMainCLICommands(TestCase): |
73 | 77 | """Tests for main CLI commands that weren't well covered previously.""" |
74 | 78 |
|
75 | 79 | @patch('cli_code.main.Config') |
@@ -110,7 +114,7 @@ def test_list_models_invalid_provider(self, mock_get_models, mock_config): |
110 | 114 | mock_get_models.assert_not_called() |
111 | 115 |
|
112 | 116 | @skip_if_imports_unavailable |
113 | | -class TestInteractiveSession(unittest.TestCase): |
| 117 | +class TestInteractiveSession(TestCase): |
114 | 118 | """Tests for interactive session functionality.""" |
115 | 119 |
|
116 | 120 | @patch('cli_code.main.get_agent_for_provider') |
|
0 commit comments