test(v1.4.0-p2): add failing tests for milestones and columns
RED phase: 5 tests in test_collector.py (collect_milestones), 10 tests in test_display.py (render_milestones, parse_columns), 2 tests in test_exporter.py (milestones JSON), 7 tests in test_cli.py (--milestones, --columns). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -138,3 +138,31 @@ class TestExportJson:
|
||||
"""Empty repo list produces '[]'."""
|
||||
output = export_json([])
|
||||
assert json.loads(output) == []
|
||||
|
||||
|
||||
class TestExportMilestonesJson:
|
||||
"""Test milestones JSON export."""
|
||||
|
||||
def test_export_milestones_json_basic(self):
|
||||
"""MilestoneData list produces valid JSON."""
|
||||
from gitea_dashboard.collector import MilestoneData
|
||||
from gitea_dashboard.exporter import export_milestones_json
|
||||
|
||||
milestones = [
|
||||
MilestoneData("repo", "v1.0", 2, 8, 80, "2026-04-01T00:00:00Z", "open"),
|
||||
]
|
||||
|
||||
output = export_milestones_json(milestones)
|
||||
parsed = json.loads(output)
|
||||
|
||||
assert len(parsed) == 1
|
||||
assert parsed[0]["repo_name"] == "repo"
|
||||
assert parsed[0]["title"] == "v1.0"
|
||||
assert parsed[0]["progress_pct"] == 80
|
||||
|
||||
def test_export_milestones_json_empty(self):
|
||||
"""Empty milestone list produces '[]'."""
|
||||
from gitea_dashboard.exporter import export_milestones_json
|
||||
|
||||
output = export_milestones_json([])
|
||||
assert json.loads(output) == []
|
||||
|
||||
Reference in New Issue
Block a user