Add test modules for analyzers
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
import pytest
|
||||||
|
from datetime import datetime
|
||||||
|
from src.models import Commit
|
||||||
|
|
||||||
|
|
||||||
|
class TestCommitPatternAnalyzer:
|
||||||
|
def test_analyze_empty_repo(self):
|
||||||
|
from src.analyzers import GitRepository
|
||||||
|
repo = GitRepository("/fake/path")
|
||||||
|
from src.analyzers import CommitPatternAnalyzer
|
||||||
|
analyzer = CommitPatternAnalyzer(repo, days=30)
|
||||||
|
result = analyzer.analyze()
|
||||||
|
assert result is None
|
||||||
|
|
||||||
|
|
||||||
|
class TestCodeChurnAnalyzer:
|
||||||
|
def test_analyze_empty_repo(self):
|
||||||
|
from src.analyzers import GitRepository
|
||||||
|
repo = GitRepository("/fake/path")
|
||||||
|
from src.analyzers import CodeChurnAnalyzer
|
||||||
|
analyzer = CodeChurnAnalyzer(repo, days=30)
|
||||||
|
result = analyzer.analyze()
|
||||||
|
assert result is None
|
||||||
|
|
||||||
|
|
||||||
|
class TestVelocityAnalyzer:
|
||||||
|
def test_analyze_empty_repo(self):
|
||||||
|
from src.analyzers import GitRepository
|
||||||
|
repo = GitRepository("/fake/path")
|
||||||
|
from src.analyzers import VelocityAnalyzer
|
||||||
|
analyzer = VelocityAnalyzer(repo, days=30)
|
||||||
|
result = analyzer.analyze()
|
||||||
|
assert result is None
|
||||||
|
|
||||||
|
|
||||||
|
class TestRiskyCommitDetector:
|
||||||
|
def test_detect_no_commits(self):
|
||||||
|
from src.analyzers import GitRepository
|
||||||
|
repo = GitRepository("/fake/path")
|
||||||
|
from src.analyzers import RiskyCommitDetector
|
||||||
|
detector = RiskyCommitDetector(repo, days=30)
|
||||||
|
result = detector.analyze()
|
||||||
|
assert result is None
|
||||||
|
|||||||
Reference in New Issue
Block a user