From d17382002649a83459d4d962dc7d5a643d2a0153 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 9 Dec 2024 16:39:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20reorganize=20imports=20?= =?UTF-8?q?and=20cleanup=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 chore: reorganize imports and cleanup tests 🔄 Refactoring: - Reorganized import statements in __main__.py - Moved import of CommitLoom to a more appropriate location ✅ Tests: - Adjusted import order in test_commit_loom.py - Ensured proper assertion in TestErrorHandling 📝 Documentation: - Added newline at the end of __init__.py for consistency Refactored code structure and improved test organization --- commitloom/__main__.py | 2 +- tests/test_commit_loom.py | 7 ++++--- tests/test_git/__init__.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/commitloom/__main__.py b/commitloom/__main__.py index 03f979a..e5283fb 100644 --- a/commitloom/__main__.py +++ b/commitloom/__main__.py @@ -11,8 +11,8 @@ env_path = os.path.join(os.path.dirname(__file__), "..", ".env") load_dotenv(dotenv_path=env_path) -from .cli.cli_handler import CommitLoom from .cli import console +from .cli.cli_handler import CommitLoom def handle_error(error: Exception) -> None: diff --git a/tests/test_commit_loom.py b/tests/test_commit_loom.py index c7fcc53..ba82c18 100644 --- a/tests/test_commit_loom.py +++ b/tests/test_commit_loom.py @@ -1,10 +1,11 @@ """Tests for CommitLoom functionality.""" -import pytest from unittest.mock import MagicMock +import pytest + from commitloom.cli.cli_handler import CommitLoom -from commitloom.core.analyzer import CommitAnalysis, Warning, WarningLevel +from commitloom.core.analyzer import CommitAnalysis from commitloom.core.git import GitError, GitFile from commitloom.services.ai_service import CommitSuggestion @@ -116,4 +117,4 @@ def test_commit_error(self, mock_deps, mocker): loom = CommitLoom() loom.run() - mock_console.print_error.assert_called() \ No newline at end of file + mock_console.print_error.assert_called() diff --git a/tests/test_git/__init__.py b/tests/test_git/__init__.py index c29d092..d3dc5ef 100644 --- a/tests/test_git/__init__.py +++ b/tests/test_git/__init__.py @@ -1 +1 @@ -"""Git test package.""" \ No newline at end of file +"""Git test package."""