(tmp_path: pathlib.Path, cli_runner: CliRunner)
| 7 | |
| 8 | |
| 9 | def test_format_cmd(tmp_path: pathlib.Path, cli_runner: CliRunner): |
| 10 | beanhub_dir = tmp_path / ".beanhub" |
| 11 | beanhub_dir.mkdir() |
| 12 | |
| 13 | bean_file = beanhub_dir / "sample.bean" |
| 14 | bean_file.write_text("2024-06-27 open Assets:Cash") |
| 15 | |
| 16 | cli_runner.mix_stderr = False |
| 17 | with switch_cwd(tmp_path): |
| 18 | result = cli_runner.invoke(cli, ["format", str(bean_file)]) |
| 19 | assert result.exit_code == 0 |
| 20 | assert bean_file.read_text() == "2024-06-27 open Assets:Cash\n" |
| 21 | |
| 22 | |
| 23 | def test_format_cmd_without_args(tmp_path: pathlib.Path, cli_runner: CliRunner): |
nothing calls this directly
no test coverage detected