32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
from typer.testing import CliRunner
|
|
|
|
from reyna_cli.cli import app
|
|
from reyna_cli.desktop_service import SERVICE_NAME, unit_content
|
|
|
|
runner = CliRunner()
|
|
|
|
|
|
def test_computer_has_device_and_service_subcommands():
|
|
result = runner.invoke(app, ["computer", "--help"])
|
|
assert result.exit_code == 0
|
|
assert "text" in result.stdout
|
|
assert "screenshot" in result.stdout
|
|
assert "service-install" in result.stdout
|
|
assert "service-status" in result.stdout
|
|
|
|
|
|
def test_devices_computer_has_subcommands():
|
|
result = runner.invoke(app, ["devices", "computer", "--help"])
|
|
assert result.exit_code == 0
|
|
assert "service-start" in result.stdout
|
|
assert "battery" in result.stdout
|
|
|
|
|
|
def test_unit_content_matches_desktop_client_gui_session():
|
|
content = unit_content()
|
|
assert SERVICE_NAME == "reyna-desktop-client.service"
|
|
assert "Environment=WAYLAND_DISPLAY=wayland-0" in content
|
|
assert "Environment=XDG_RUNTIME_DIR=/run/user/1000" in content
|
|
assert "ExecStart=/usr/bin/python3 /home/adolforeyna/Projects/Screen/desktop_client/client.py" in content
|
|
assert "Restart=always" in content
|