Establish automated test foundation
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from serato_doctor.scanner import scan_audio
|
||||
|
||||
|
||||
def test_scan_audio_finds_supported_files(tmp_path):
|
||||
music = tmp_path / "music"
|
||||
nested = music / "House"
|
||||
nested.mkdir(parents=True)
|
||||
(nested / "First.MP3").write_bytes(b"synthetic audio")
|
||||
(nested / "Second.flac").write_bytes(b"fixture")
|
||||
(nested / "notes.txt").write_text("not audio", encoding="utf-8")
|
||||
|
||||
tracks = scan_audio(music)
|
||||
|
||||
assert {track.filename for track in tracks} == {"First.MP3", "Second.flac"}
|
||||
first = next(track for track in tracks if track.filename == "First.MP3")
|
||||
assert first.suffix == ".mp3"
|
||||
assert first.size == len(b"synthetic audio")
|
||||
Reference in New Issue
Block a user