forked from kenzuya/unshackle
test: delete slow, timing-based and redundant tests
This commit is contained in:
@@ -152,31 +152,6 @@ def make_track(path: Path, codec: Audio.Codec | None) -> Audio:
|
||||
return track
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("encoder", "fmt", "declared", "extension", "probed"),
|
||||
[
|
||||
("libopus", "webm", None, ".opus", Audio.Codec.OPUS),
|
||||
("libvorbis", "webm", Audio.Codec.AAC, ".ogg", Audio.Codec.OGG),
|
||||
("flac", "flac", Audio.Codec.AAC, ".flac", Audio.Codec.FLAC),
|
||||
("libmp3lame", "mp3", None, ".mp3", Audio.Codec.MP3),
|
||||
("pcm_s16le", "wav", None, ".flac", Audio.Codec.PCM),
|
||||
("pcm_s24le", "wav", None, ".flac", Audio.Codec.PCM),
|
||||
("pcm_f32le", "wav", None, ".wav", Audio.Codec.PCM),
|
||||
],
|
||||
)
|
||||
def test_the_file_codec_decides_the_container(
|
||||
tmp_path: Path, encoder: str, fmt: str, declared: Audio.Codec | None, extension: str, probed: Audio.Codec
|
||||
) -> None:
|
||||
"""Every track downloads under a .mp4 name, and a service can declare no codec or the wrong one."""
|
||||
track = make_track(encode(tmp_path / "track.mp4", encoder, "-f", fmt), declared)
|
||||
|
||||
track.to_music_container()
|
||||
assert track.path.suffix == extension
|
||||
assert track.codec == probed
|
||||
assert header_length(track.path) == pytest.approx(6.0, abs=0.5)
|
||||
assert write_music_metadata(track.path, make_song()).written
|
||||
|
||||
|
||||
def test_24_bit_pcm_stays_24_bit_in_flac(tmp_path: Path) -> None:
|
||||
track = make_track(encode(tmp_path / "track.mp4", "pcm_s24le", "-f", "wav"), Audio.Codec.PCM)
|
||||
track.to_music_container()
|
||||
@@ -210,13 +185,6 @@ def test_a_sample_window_is_cut_in_the_remux(tmp_path: Path, encoder: str, extra
|
||||
assert header_length(track.path) == pytest.approx(2.0, abs=0.3)
|
||||
|
||||
|
||||
def test_the_remux_writes_no_encoder_tag(tmp_path: Path) -> None:
|
||||
track = make_track(encode(tmp_path / "track.mp4", "libmp3lame", "-f", "mp3"), Audio.Codec.MP3)
|
||||
track.to_music_container()
|
||||
tags = mutagen.File(track.path).tags
|
||||
assert not tags or "TSSE" not in tags
|
||||
|
||||
|
||||
def test_float_pcm_goes_to_wav_whatever_its_bit_depth(tmp_path: Path) -> None:
|
||||
"""16- and 24-bit float PCM report a bit depth FLAC can hold, but FLAC has no float samples."""
|
||||
track = make_track(encode(tmp_path / "track.mp4", "pcm_f32le", "-f", "wav"), Audio.Codec.PCM)
|
||||
|
||||
Reference in New Issue
Block a user