Files
led-sync-studio/tests/test_scaffold.py
Claude ffc2379784 feat(02-01): bootstrap Python project scaffold with all Phase 2 dependencies
- uv project configured as led-sync-studio, requires-python >= 3.11
- Dependencies declared: miniaudio==1.61, sounddevice==0.5.5, numpy>=2.4.4, pydantic==2.12.5, aubio>=0.4.9
- aubio built from source (no aarch64 wheel on PyPI)
- sounddevice installed; requires libportaudio2 on target system (Raspberry Pi OS)
- dev deps: pytest>=8.0, pytest-asyncio>=0.23
- Tests pass: led_sync importable, all deps installed
2026-04-03 14:21:09 +02:00

55 lines
1.9 KiB
Python

"""TDD: Tests for project scaffold — verifying package and dependency availability."""
import subprocess
import sys
import importlib.util
def test_led_sync_importable():
"""led_sync package must be importable with a __version__ attribute."""
result = subprocess.run(
["uv", "run", "python", "-c", "import led_sync; print(led_sync.__version__)"],
capture_output=True,
text=True,
cwd="/home/claude/keineahnungirgendeintesthalt",
)
assert result.returncode == 0, f"Import failed: {result.stderr}"
assert result.stdout.strip(), "No version printed"
def test_core_dependencies_importable():
"""All Phase 2 core deps must be importable. sounddevice requires libportaudio2
system library which may not be available on all dev environments — documented
in SUMMARY as requiring `apt install libportaudio2` on Raspberry Pi OS.
"""
# Test deps that don't require system audio libraries
result = subprocess.run(
[
"uv",
"run",
"python",
"-c",
"import miniaudio, numpy, pydantic, aubio; print('OK')",
],
capture_output=True,
text=True,
cwd="/home/claude/keineahnungirgendeintesthalt",
)
assert result.returncode == 0, f"Dependency import failed: {result.stderr}"
assert "OK" in result.stdout
# Test sounddevice is installed as a package (may need libportaudio2 at runtime)
result_sd = subprocess.run(
[
"uv",
"run",
"python",
"-c",
"import importlib.util; spec = importlib.util.find_spec('sounddevice'); print('sounddevice found' if spec else 'sounddevice NOT found')",
],
capture_output=True,
text=True,
cwd="/home/claude/keineahnungirgendeintesthalt",
)
assert result_sd.returncode == 0
assert "sounddevice found" in result_sd.stdout, "sounddevice package not installed"