sintonia/analyzer/tests/pipeline/analyze_replaygain_test.py

17 lines
462 B
Python
Raw Normal View History

import pytest
from libretime_analyzer.pipeline.analyze_replaygain import analyze_replaygain
from ..fixtures import FILES
2021-08-30 21:23:48 +02:00
@pytest.mark.parametrize(
2021-08-30 21:23:48 +02:00
"filepath,replaygain",
map(lambda i: pytest.param(str(i.path), i.replaygain, id=i.path.name), FILES),
)
def test_analyze_replaygain(filepath, replaygain):
tolerance = 0.8
2021-05-27 16:23:02 +02:00
metadata = analyze_replaygain(filepath, {})
assert metadata["replay_gain"] == pytest.approx(replaygain, abs=tolerance)