MCPcopy Create free account
hub / github.com/LaunchPlatform/beanhub-cli / test_format_cmd

Function test_format_cmd

tests/test_format.py:9–20  ·  view source on GitHub ↗
(tmp_path: pathlib.Path, cli_runner: CliRunner)

Source from the content-addressed store, hash-verified

7
8
9def 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
23def test_format_cmd_without_args(tmp_path: pathlib.Path, cli_runner: CliRunner):

Callers

nothing calls this directly

Calls 1

switch_cwdFunction · 0.85

Tested by

no test coverage detected