import os from lyra_worker.pipeline import _count_staged_audio def test_count_staged_audio_counts_nested_audio_files_only(tmp_path): nested = tmp_path / "Artist" / "Album" nested.mkdir(parents=True) (nested / "01.flac").write_bytes(b"") (nested / "02.flac").write_bytes(b"") (nested / "03.flac").write_bytes(b"") (nested / "cover.jpg").write_bytes(b"") assert _count_staged_audio(str(tmp_path)) == 3 def test_count_staged_audio_empty_dir_is_zero(tmp_path): assert _count_staged_audio(str(tmp_path)) == 0 def test_count_staged_audio_missing_dir_is_zero(): assert _count_staged_audio("/nonexistent/path/for/sure") == 0