Refactor: extract audio.py, add 50 unit tests
- Extract MPRISController and PulseController into src/turnup/audio.py; turnupd.py imports from there, dropping ~270 lines of duplicated code - Add [project.optional-dependencies] dev = [pytest] and pytest testpaths to pyproject.toml - Add tests/test_audio.py: 31 tests covering MPRISController player matching, volume clamping, cache TTL, and PulseController MPRIS-first routing, PA fallback, and drain_events - Add tests/test_protocol.py: 19 tests covering parse_messages framing, multi-message buffers, garbage skipping, and knob conversion helpers - All 50 tests pass (pytest 9.0, Python 3.14)
This commit is contained in:
6 files changed
+720
-272
No files matched your search
@@ -15,6 +15,12 @@ dependencies = [
|
||||
"tomli>=1.1; python_version < '3.11'",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ["pytest>=8.0"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
|
||||
[project.scripts]
|
||||
turnupd = "turnup.turnupd:main"
|
||||
|
||||
|
||||
Reference in new issue
Block a user