Test: errori di configurazione e CSV, domini.toml non validi, exit code CLI, varianti di report e grafici
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bb2e3bd2d4
commit
cfb1eb66a5
5 files changed
+104
No files matched your search
@@ -43,3 +43,24 @@ def test_cli_errori(tmp_path):
|
||||
with pytest.raises(SystemExit) as e:
|
||||
cli.main(["--config", "/non/esiste.toml", "domini", "x.csv"])
|
||||
assert e.value.code == 3
|
||||
|
||||
|
||||
def test_cli_domini_non_validi_exit_6(tmp_path):
|
||||
csv = csv_sintetico(tmp_path)
|
||||
toml = tmp_path / "d.toml"
|
||||
toml.write_text('[[dominio]]\ntipo="riposo"\nt0_s=0\nt1_s=10\n[[dominio]]\ntipo="raffreddamento"\nt0_s=20\nt1_s=30\n')
|
||||
with pytest.raises(SystemExit) as e:
|
||||
cli.main(["--config", str(RADICE / "config.toml"), "--output", str(tmp_path / "out"), "analizza", str(csv), "--domini", str(toml)])
|
||||
assert e.value.code == 6
|
||||
with pytest.raises(SystemExit) as e:
|
||||
cli.main(["--config", str(RADICE / "config.toml"), "--output", str(tmp_path / "out"), "analizza", str(csv),
|
||||
"--domini", str(tmp_path / "manca.toml")])
|
||||
assert e.value.code == 6
|
||||
|
||||
|
||||
def test_cli_csv_non_valido_exit_4(tmp_path):
|
||||
csv = tmp_path / "vuoto.csv"
|
||||
csv.write_text("t_ms,T_C,dT_C\n")
|
||||
with pytest.raises(SystemExit) as e:
|
||||
cli.main(["--config", str(RADICE / "config.toml"), "--output", str(tmp_path / "out"), "domini", str(csv)])
|
||||
assert e.value.code == 4
|
||||
Reference in new issue
Block a user