Skip to content

Commit eaa9f40

Browse files
committed
Fix broken tests
1 parent bde93f1 commit eaa9f40

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

tests/test_cli.py

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -209,38 +209,33 @@ def test_benchmark_invalid_range(self):
209209
class TestLegacyMain:
210210
"""Test the legacy main function for backward compatibility."""
211211

212-
@patch("isnt_that_odd.cli.is_even")
212+
@patch("isnt_that_odd.core.is_even")
213213
def test_legacy_main_success(self, mock_is_even):
214214
"""Test legacy main function still works."""
215215
from isnt_that_odd.cli import main
216216

217217
mock_is_even.return_value = True
218218

219-
# Test that the main function calls check.callback correctly
220-
# Since main is not a Click command, we test it differently
221-
with patch("isnt_that_odd.cli.check") as mock_check:
222-
main("42")
223-
mock_check.callback.assert_called_once_with(
224-
number="42",
225-
model="gpt-3.5-turbo",
226-
api_key=None,
227-
base_url=None,
228-
verbose=False,
229-
)
219+
# Test that the main function calls is_even correctly
220+
main("42")
221+
mock_is_even.assert_called_once_with(
222+
number=42,
223+
model="gpt-3.5-turbo",
224+
api_key=None,
225+
base_url=None,
226+
)
230227

231-
@patch("isnt_that_odd.cli.is_even")
228+
@patch("isnt_that_odd.core.is_even")
232229
def test_legacy_main_with_options(self, mock_is_even):
233230
"""Test legacy main function with custom options."""
234231
from isnt_that_odd.cli import main
235232

236233
mock_is_even.return_value = True
237234

238-
with patch("isnt_that_odd.cli.check") as mock_check:
239-
main("42", model="gpt-4", api_key="test-key", verbose=True)
240-
mock_check.callback.assert_called_once_with(
241-
number="42",
242-
model="gpt-4",
243-
api_key="test-key",
244-
base_url=None,
245-
verbose=True,
246-
)
235+
main("42", model="gpt-4", api_key="test-key", verbose=True)
236+
mock_is_even.assert_called_once_with(
237+
number=42,
238+
model="gpt-4",
239+
api_key="test-key",
240+
base_url=None,
241+
)

0 commit comments

Comments
 (0)