feat: JSON, Excel export and time summary
- #23: add JSONFormatter and XLSXFormatter - add openpyxl dependency for .xlsx export - #22: add --summary flag and calculate_summary() in report_builder - ReportRow now carries raw hours for summary calculations - update CLI help and README with .json/.xlsx formats and --summary - add tests for new formatters and summary computation Closes #22, closes #23
This commit is contained in:
@@ -170,6 +170,18 @@ def test_cli_config_file_loading(mock_fetch, tmp_path):
|
||||
assert code == 0
|
||||
|
||||
|
||||
@mock.patch.dict(os.environ, VALID_ENV, clear=True)
|
||||
@mock.patch("redmine_reporter.cli.fetch_issues_with_spent_time")
|
||||
def test_cli_summary_flag_prints_totals(mock_fetch, capsys):
|
||||
"""--summary выводит общее время и разбивку по проектам в stderr."""
|
||||
issue = _MockIssue()
|
||||
mock_fetch.return_value = [(issue, 1.0)]
|
||||
main(["--date", "2026-01-01--2026-01-31", "--summary"])
|
||||
captured = capsys.readouterr()
|
||||
assert "Total time" in captured.err
|
||||
assert "Project" in captured.err or "Project" in captured.out
|
||||
|
||||
|
||||
@mock.patch.dict(os.environ, VALID_ENV, clear=True)
|
||||
@mock.patch("redmine_reporter.cli.fetch_issues_with_spent_time")
|
||||
def test_total_issues_message_goes_to_stderr(mock_fetch, capsys):
|
||||
|
||||
Reference in New Issue
Block a user