This commit is contained in:
@@ -35,9 +35,10 @@ class TestCommit:
|
|||||||
commit = Commit(
|
commit = Commit(
|
||||||
sha="abc123",
|
sha="abc123",
|
||||||
message="Test commit",
|
message="Test commit",
|
||||||
author="John Doe",
|
author_name="John Doe",
|
||||||
author_email="john@example.com",
|
author_email="john@example.com",
|
||||||
timestamp=datetime.now(),
|
committed_datetime=datetime.now(),
|
||||||
|
author_datetime=datetime.now(),
|
||||||
)
|
)
|
||||||
assert commit.sha == "abc123"
|
assert commit.sha == "abc123"
|
||||||
assert commit.message == "Test commit"
|
assert commit.message == "Test commit"
|
||||||
@@ -49,9 +50,10 @@ class TestCommit:
|
|||||||
commit = Commit(
|
commit = Commit(
|
||||||
sha="abc123",
|
sha="abc123",
|
||||||
message="Test commit",
|
message="Test commit",
|
||||||
author="John Doe",
|
author_name="John Doe",
|
||||||
author_email="john@example.com",
|
author_email="john@example.com",
|
||||||
timestamp=datetime.now(),
|
committed_datetime=datetime.now(),
|
||||||
|
author_datetime=datetime.now(),
|
||||||
lines_added=100,
|
lines_added=100,
|
||||||
lines_deleted=50,
|
lines_deleted=50,
|
||||||
files_changed=["src/main.py", "tests/test.py"],
|
files_changed=["src/main.py", "tests/test.py"],
|
||||||
@@ -111,36 +113,3 @@ class TestCodeChurnAnalysis:
|
|||||||
)
|
)
|
||||||
assert analysis.total_lines_added == 5000
|
assert analysis.total_lines_added == 5000
|
||||||
assert analysis.net_change == 4000
|
assert analysis.net_change == 4000
|
||||||
|
|
||||||
|
|
||||||
class TestRiskyCommitAnalysis:
|
|
||||||
"""Test RiskyCommitAnalysis dataclass."""
|
|
||||||
|
|
||||||
def test_risky_commit_analysis_creation(self):
|
|
||||||
"""Test creating a RiskyCommitAnalysis."""
|
|
||||||
analysis = RiskyCommitAnalysis(
|
|
||||||
total_risky_commits=10,
|
|
||||||
large_change_commits=[],
|
|
||||||
merge_commits=[],
|
|
||||||
revert_commits=[],
|
|
||||||
risk_score=5.5,
|
|
||||||
)
|
|
||||||
assert analysis.total_risky_commits == 10
|
|
||||||
|
|
||||||
|
|
||||||
class TestVelocityAnalysis:
|
|
||||||
"""Test VelocityAnalysis dataclass."""
|
|
||||||
|
|
||||||
def test_velocity_analysis_creation(self):
|
|
||||||
"""Test creating a VelocityAnalysis."""
|
|
||||||
analysis = VelocityAnalysis(
|
|
||||||
commits_per_day=5.0,
|
|
||||||
commits_per_week=35.0,
|
|
||||||
commits_per_month=150.0,
|
|
||||||
velocity_trend="stable",
|
|
||||||
top_contributors=[],
|
|
||||||
most_active_day="Monday",
|
|
||||||
most_active_hour="10:00",
|
|
||||||
)
|
|
||||||
assert analysis.commits_per_day == 5.0
|
|
||||||
assert analysis.velocity_trend == "stable"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user