From 838a1ade0d93b8c0723f1fa138e2ad8dd3730a04 Mon Sep 17 00:00:00 2001 From: Kavi Date: Tue, 25 Feb 2025 14:46:40 +0100 Subject: [PATCH] Updated get_samplerate test to use example data file. --- tests/test_audio_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_audio_utils.py b/tests/test_audio_utils.py index ebe2f0f..c223ecf 100644 --- a/tests/test_audio_utils.py +++ b/tests/test_audio_utils.py @@ -137,9 +137,10 @@ def test_pad_audio_with_fixed_width(duration: float, width: int): assert expected_width == width def test_get_samplerate_using_bytesio(): - audio_url="https://anon.erda.au.dk/share_redirect/e5c7G2AWmg/F1/20240724/2MU02597/BIOBD01_20240626_231650.wav" + with open("example_data/audio/20170701_213954-MYOMYS-LR_0_0.5.wav", "rb") as f: + audio_bytes = io.BytesIO(f.read()) - sample_rate = audio_utils.get_samplerate(io.BytesIO(requests.get(audio_url).content)) + sample_rate = audio_utils.get_samplerate(audio_bytes) - expected_sample_rate = 256000 + expected_sample_rate = 500000 assert expected_sample_rate == sample_rate