File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ import json
4+ from pathlib import Path
5+
6+ from turkishevalkit .cli import main
7+
8+
9+ def test_reliability_cli_json_output (capsys : object ) -> None :
10+ exit_code = main (["reliability" , "examples/reliability-text.json" , "--json" ])
11+
12+ assert exit_code == 0
13+ captured = capsys .readouterr () # type: ignore[attr-defined]
14+ payload = json .loads (captured .out )
15+ assert payload ["evaluation_type" ] == "text"
16+ assert payload ["task_count" ] == 3
17+ assert payload ["declared_minimum_task_count" ] == 3
18+ assert payload ["fixed_evaluator_panel" ] is True
19+ assert payload ["criterion_reliability" ]["fluency" ]["krippendorff_alpha" ]["applicable" ] is True
20+
21+
22+ def test_reliability_cli_writes_report (tmp_path : Path , capsys : object ) -> None :
23+ output = tmp_path / "reliability-report.json"
24+
25+ exit_code = main (
26+ [
27+ "reliability" ,
28+ "examples/reliability-text.json" ,
29+ "--output" ,
30+ str (output ),
31+ ]
32+ )
33+
34+ assert exit_code == 0
35+ assert output .is_file ()
36+ payload = json .loads (output .read_text (encoding = "utf-8" ))
37+ assert payload ["rubric_id" ] == "tr-text-quality"
38+ captured = capsys .readouterr () # type: ignore[attr-defined]
39+ assert "3 tasks" in captured .out
40+ assert "fluency" in captured .out
You can’t perform that action at this time.
0 commit comments