first commit
This commit is contained in:
22
tests/test_merge.py
Normal file
22
tests/test_merge.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from app.merge import filter_activity_source, merge_activity
|
||||
|
||||
|
||||
def test_merge_activity_combines_totals() -> None:
|
||||
github = {"2026-01-01": 2, "2026-01-02": 1}
|
||||
gitea = {"2026-01-02": 3, "2026-01-03": 4}
|
||||
|
||||
merged = merge_activity(github, gitea)
|
||||
|
||||
assert merged["2026-01-01"] == {"github": 2, "gitea": 0, "total": 2}
|
||||
assert merged["2026-01-02"] == {"github": 1, "gitea": 3, "total": 4}
|
||||
assert merged["2026-01-03"] == {"github": 0, "gitea": 4, "total": 4}
|
||||
|
||||
|
||||
def test_filter_activity_source_github_only() -> None:
|
||||
merged = {
|
||||
"2026-01-01": {"github": 2, "gitea": 7, "total": 9},
|
||||
}
|
||||
|
||||
filtered = filter_activity_source(merged, "github")
|
||||
|
||||
assert filtered["2026-01-01"] == {"github": 2, "gitea": 0, "total": 2}
|
||||
Reference in New Issue
Block a user