test: delete slow, timing-based and redundant tests

This commit is contained in:
imSp4rky
2026-12-05 15:20:05 -07:00
parent 783a2fc185
commit 3a0a74e694
292 changed files with 153 additions and 15174 deletions
@@ -50,53 +50,6 @@ def make_audio(path: Path, codec: Audio.Codec, track_id: str) -> Audio:
return track
def test_the_hook_remuxes_every_audio_track_of_a_song(tmp_path: Path) -> None:
song = make_song()
song.tracks = Tracks(
[
make_audio(fragmented_mp4(tmp_path / "Audio_a1.mp4", "flac"), Audio.Codec.FLAC, "a1"),
make_audio(fragmented_mp4(tmp_path / "Audio_a2.mp4", "aac"), Audio.Codec.AAC, "a2"),
]
)
remux_music_tracks(song, log)
assert [t.path.suffix for t in song.tracks.audio] == [".flac", ".m4a"]
for track in song.tracks.audio:
assert header_length(track.path) == pytest.approx(6.0, abs=0.5)
def test_one_broken_track_warns_and_does_not_stop_the_rest(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None:
broken = tmp_path / "Audio_a1.mp4"
broken.write_bytes(b"") # ffmpeg cannot read this, so its remux must fail
song = make_song()
song.tracks = Tracks(
[
make_audio(broken, Audio.Codec.AAC, "a1"),
make_audio(fragmented_mp4(tmp_path / "Audio_a2.mp4", "aac"), Audio.Codec.AAC, "a2"),
]
)
with caplog.at_level(logging.WARNING, logger=log.name):
remux_music_tracks(song, log)
assert "Could not remux audio track a1" in caplog.text
assert song.tracks.audio[0].path == broken, "a failed remux must keep the downloaded file"
assert song.tracks.audio[1].path.suffix == ".m4a", "the failure must not stop the other tracks"
def test_a_non_song_title_is_left_alone(tmp_path: Path) -> None:
source = fragmented_mp4(tmp_path / "Audio_a1.mp4", "aac")
track = make_audio(source, Audio.Codec.AAC, "a1")
class NotASong:
tracks = Tracks([track])
remux_music_tracks(NotASong(), log)
assert track.path == source
def test_a_fragmented_flac_song_ends_playable_named_and_tagged(tmp_path: Path, default_templates: None) -> None:
"""The full post-download flow: hook, MediaInfo naming, final move, music tagging."""
song = make_song()