Add exporters, utils, and tests
Some checks failed
CI / test (push) Has been cancelled
CI / lint (push) Has been cancelled

This commit is contained in:
2026-01-30 05:31:01 +00:00
parent 1c075a28ac
commit 7292ec9371

34
.tests/test_git.py Normal file
View File

@@ -0,0 +1,34 @@
"""Tests for git parsing."""
import tempfile
from pathlib import Path
import pytest
from termflow.parsers.git_parser import GitLogParser, Commit, WorkflowStats
class TestGitLogParser:
"""Test git log parser."""
def test_is_git_repo_true(self, tmp_path):
"""Test detection of git repository."""
(tmp_path / ".git").mkdir()
parser = GitLogParser(tmp_path)
assert parser.is_git_repo() is True
def test_is_git_repo_false(self, tmp_path):
"""Test detection of non-git directory."""
parser = GitLogParser(tmp_path)
assert parser.is_git_repo() is False
def test_parse_log_empty(self, tmp_path):
"""Test parsing empty git log."""
parser = GitLogParser(tmp_path)
commits = parser.parse_log()
assert commits == []
def test_analyze_workflow(self):
"""Test workflow analysis."""
parser = GitLogParser(Path.cwd())
stats = parser.analyze_workflow()
assert isinstance(stats, WorkflowStats)