summaryrefslogtreecommitdiff
path: root/tests/test_cli.py
blob: 09de22c086c4d564c55f430ea24d255a4d6df7d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from pathlib import Path

from mic_clipper.cli import main


def test_service_install_dry_run_prints_commands_without_creating_unit(tmp_path, capsys):
    unit_path = tmp_path / "mic-clipper.service"

    result = main(
        [
            "service",
            "install",
            "--dry-run",
            "--unit-path",
            str(unit_path),
            "--project-root",
            str(tmp_path),
            "--python",
            "/runtime/python",
        ]
    )

    assert result == 0
    assert not unit_path.exists()
    assert "systemctl --user enable --now mic-clipper.service" in capsys.readouterr().out