Skip to content

Commit 59c1830

Browse files
author
Test User
committed
🔧 fix: update commit loom calls with api_key
🔧 fix: update commit loom calls with api_key 🐛 Fixes: - Removed unused imports in test_commit_loom.py - Updated mock_commit_loom calls to include api_key=None in test_main.py Refined test files by optimizing imports and correcting mock calls
1 parent 23f0986 commit 59c1830

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/test_commit_loom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from commitloom.cli.cli_handler import CommitLoom
88
from commitloom.core.analyzer import CommitAnalysis
9-
from commitloom.core.git import GitError, GitFile, GitOperations
9+
from commitloom.core.git import GitError, GitFile
1010
from commitloom.services.ai_service import CommitSuggestion, TokenUsage
1111

1212

tests/test_main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_basic_run(self, runner, mock_loom):
3838
result = runner.invoke(main)
3939

4040
assert result.exit_code == 0
41-
mock_commit_loom.assert_called_once_with(test_mode=True)
41+
mock_commit_loom.assert_called_once_with(test_mode=True, api_key=None)
4242
mock_loom.run.assert_called_once_with(
4343
auto_commit=False, combine_commits=False, debug=False
4444
)
@@ -50,7 +50,7 @@ def test_all_flags(self, runner, mock_loom):
5050
result = runner.invoke(main, ["-y", "-c", "-d"])
5151

5252
assert result.exit_code == 0
53-
mock_commit_loom.assert_called_once_with(test_mode=True)
53+
mock_commit_loom.assert_called_once_with(test_mode=True, api_key=None)
5454
mock_loom.run.assert_called_once_with(
5555
auto_commit=True, combine_commits=True, debug=True
5656
)
@@ -68,7 +68,7 @@ def test_keyboard_interrupt(self, runner, mock_loom):
6868
result = runner.invoke(main)
6969

7070
assert result.exit_code == 1
71-
mock_commit_loom.assert_called_once_with(test_mode=True)
71+
mock_commit_loom.assert_called_once_with(test_mode=True, api_key=None)
7272
assert "Operation cancelled by user" in result.output
7373

7474
def test_general_error(self, runner, mock_loom):
@@ -80,5 +80,5 @@ def test_general_error(self, runner, mock_loom):
8080
result = runner.invoke(main)
8181

8282
assert result.exit_code == 1
83-
mock_commit_loom.assert_called_once_with(test_mode=True)
83+
mock_commit_loom.assert_called_once_with(test_mode=True, api_key=None)
8484
assert "Test error" in result.output

0 commit comments

Comments
 (0)