Fix CI/CD: Add Gitea Actions workflow and fix linting issues
Some checks failed
CI / test (push) Failing after 13s

This commit is contained in:
Developer
2026-02-05 09:02:49 +00:00
commit d8325c4be2
111 changed files with 19657 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
from pathlib import Path
from src.git.git import FileChange, GitRepo
class TestGitRepo:
def test_get_file_language(self):
repo = GitRepo(Path.cwd())
assert repo.get_file_language("test.py") == "python"
assert repo.get_file_language("test.js") == "javascript"
assert repo.get_file_language("test.go") == "go"
assert repo.get_file_language("test.rs") == "rust"
assert repo.get_file_language("test.unknown") == "unknown"
def test_get_diff_stats(self):
repo = GitRepo(Path.cwd())
diff = """diff --git a/test.py b/test.py
--- a/test.py
+++ b/test.py
@@ -1,3 +1,4 @@
def hello():
+ print("hello")
return True
- return False
"""
additions, deletions = repo.get_diff_stats(diff)
assert additions == 1
assert deletions == 1
class TestFileChange:
def test_file_change_creation(self):
change = FileChange(
filename="test.py",
status="M",
diff="diff content"
)
assert change.filename == "test.py"
assert change.status == "M"
assert change.diff == "diff content"