summaryrefslogtreecommitdiff
path: root/tests/test_service.py
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-29 11:00:01 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-29 11:00:01 +0800
commit9d3c7500ee39e1e4c757176b5a41ce918072e093 (patch)
treefe499785e9abf78372038a0f9b46cc4dba086ff7 /tests/test_service.py
parentb927b2c2746efaf7f91d03cec1c123a3d52bf62b (diff)
downloadmic-clipper-9d3c7500ee39e1e4c757176b5a41ce918072e093.tar.gz
fix(service): correct systemd module entrypointHEADmain
[Problem] - The installed user service fails before recording starts. [Root Cause] - The unit invokes the package without its CLI module and places StartLimit directives in [Service]. [Solution] - Invoke mic_clipper.cli and move StartLimit directives to [Unit]. - Cover both rendered-unit requirements with the service test. [Impact] - The service template and its regression test are updated.
Diffstat (limited to 'tests/test_service.py')
-rw-r--r--tests/test_service.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_service.py b/tests/test_service.py
index 2bda2ab..5aacbcc 100644
--- a/tests/test_service.py
+++ b/tests/test_service.py
@@ -3,13 +3,15 @@ from pathlib import Path
from mic_clipper.service import install, render_unit, uninstall
-def test_rendered_service_waits_for_audio_services_and_restarts_only_on_failure():
+def test_rendered_service_uses_cli_entrypoint_and_places_start_limits_in_unit():
unit = render_unit(Path("/runtime/python"), Path("/project"))
assert "After=pipewire.service wireplumber.service pipewire-pulse.service" in unit
+ assert "StartLimitIntervalSec=300" in unit.split("[Service]", maxsplit=1)[0]
+ assert "StartLimitBurst=10" in unit.split("[Service]", maxsplit=1)[0]
assert "Restart=on-failure" in unit
assert "RestartMaxDelaySec=60s" in unit
- assert "ExecStart=/runtime/python -m mic_clipper run" in unit
+ assert "ExecStart=/runtime/python -m mic_clipper.cli run" in unit
assert "UMask=0077" in unit