mirror of
https://github.com/elder-plinius/OBLITERATUS.git
synced 2026-08-17 16:37:30 +02:00
feat(cli): add aggregate output format options for docs parity
The README/CONTRIBUTING examples used `obliteratus aggregate --format ...` but the CLI only accepted `--dir`.
This adds `--format {summary,latex}`, `--metric`, and `--min-runs` to the aggregate command, reuses community LaTeX table generation, and adds CLI parsing tests to align behavior with documented usage.
This commit is contained in:
committed by
Joseph Magly
parent
a5a1ffa584
commit
2295ef3571
@@ -101,6 +101,29 @@ class TestCLIDispatch:
|
||||
)
|
||||
assert "no contributions found" in printed_text.lower() or mock_console.print.called
|
||||
|
||||
def test_aggregate_accepts_format_metric_min_runs(self):
|
||||
"""aggregate accepts --format, --metric and --min-runs flags."""
|
||||
with patch("obliteratus.cli._cmd_aggregate") as mock_cmd:
|
||||
main([
|
||||
"aggregate",
|
||||
"--format", "latex",
|
||||
"--metric", "refusal_rate",
|
||||
"--min-runs", "3",
|
||||
])
|
||||
mock_cmd.assert_called_once()
|
||||
args_passed = mock_cmd.call_args[0][0]
|
||||
assert args_passed.format == "latex"
|
||||
assert args_passed.metric == "refusal_rate"
|
||||
assert args_passed.min_runs == 3
|
||||
|
||||
def test_aggregate_rejects_invalid_format(self):
|
||||
"""aggregate rejects unknown --format choices."""
|
||||
stderr_text = _capture_exit(
|
||||
["aggregate", "--format", "invalid"],
|
||||
expect_code=2,
|
||||
)
|
||||
assert "invalid choice" in stderr_text.lower()
|
||||
|
||||
# 7. --help flag prints help
|
||||
def test_help_flag(self):
|
||||
"""Calling main(['--help']) should print help and exit 0."""
|
||||
|
||||
Reference in New Issue
Block a user