rename samples/ to test_audio, and move it to tests/
This commit is contained in:
+3
-3
@@ -3,11 +3,11 @@ from src.input.file_reader import read_audio
|
|||||||
from src.input.format_checker import is_supported_format
|
from src.input.format_checker import is_supported_format
|
||||||
|
|
||||||
def test_read_audio():
|
def test_read_audio():
|
||||||
file_path = "samples/cafe_crowd_talk.aiff"
|
file_path = "tests/test_audio/cafe_crowd_talk.aiff"
|
||||||
audio, sr = read_audio(file_path)
|
audio, sr = read_audio(file_path)
|
||||||
assert len(audio) > 0
|
assert len(audio) > 0
|
||||||
assert sr > 0
|
assert sr > 0
|
||||||
|
|
||||||
def test_is_supported_format():
|
def test_is_supported_format():
|
||||||
assert is_supported_format("samples/cafe_crowd_talk.aiff") == True
|
assert is_supported_format("tests/test_audio/cafe_crowd_talk.aiff") == True
|
||||||
assert is_supported_format("samples/unsupported_file.txt") == False
|
assert is_supported_format("tests/test_audio/unsupported_file.txt") == False
|
||||||
@@ -8,7 +8,7 @@ from src.input.file_reader import read_audio
|
|||||||
from src.preprocessing.resample import resample
|
from src.preprocessing.resample import resample
|
||||||
|
|
||||||
def test_normalize_audio():
|
def test_normalize_audio():
|
||||||
file_path = "samples/cafe_crowd_talk.aiff"
|
file_path = "tests/test_audio/cafe_crowd_talk.aiff"
|
||||||
audio, _ = read_audio(file_path)
|
audio, _ = read_audio(file_path)
|
||||||
normalized_audio = normalize_audio(audio)
|
normalized_audio = normalize_audio(audio)
|
||||||
|
|
||||||
@@ -16,14 +16,14 @@ def test_normalize_audio():
|
|||||||
assert normalized_audio.min() >= -1.0
|
assert normalized_audio.min() >= -1.0
|
||||||
|
|
||||||
def test_trim_audio():
|
def test_trim_audio():
|
||||||
file_path = "samples/cafe_crowd_talk.aiff"
|
file_path = "tests/test_audio/cafe_crowd_talk.aiff"
|
||||||
audio, sr = read_audio(file_path)
|
audio, sr = read_audio(file_path)
|
||||||
trimmed_audio = trim_audio(audio, sr)
|
trimmed_audio = trim_audio(audio, sr)
|
||||||
|
|
||||||
assert len(trimmed_audio) <= len(audio)
|
assert len(trimmed_audio) <= len(audio)
|
||||||
|
|
||||||
def test_classify():
|
def test_classify():
|
||||||
file_path = "samples/cafe_crowd_talk.wav"
|
file_path = "tests/test_audio/cafe_crowd_talk.wav"
|
||||||
expected_class = "Speech"
|
expected_class = "Speech"
|
||||||
predicted_class = classify_audio(file_path)
|
predicted_class = classify_audio(file_path)
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ def test_demucs_separation_with_preprocessing():
|
|||||||
Test to ensure Demucs separation works with preprocessing and creates expected outputs.
|
Test to ensure Demucs separation works with preprocessing and creates expected outputs.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
input_file = "./samples/am_contra_heart_peripheral.wav"
|
input_file = "tests/test_audio/am_contra_heart_peripheral.wav"
|
||||||
file_name = Path(input_file).stem
|
file_name = Path(input_file).stem
|
||||||
output_path = "/tmp/demucs-test"
|
output_path = "/tmp/demucs-test"
|
||||||
waveform, samplerate = read_audio(input_file)
|
waveform, samplerate = read_audio(input_file)
|
||||||
|
|||||||
Reference in New Issue
Block a user