-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
41 lines (33 loc) · 1.39 KB
/
Copy pathtests.py
File metadata and controls
41 lines (33 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from cgi import test
import afm.checker.audio_file_checker_factory as afcf
from afm.exporter.audio_file_exporter import audio_file_exporter
from afm.dual_mono_converter import dual_mono_converter
def test_wav_mono() -> bool:
a = afcf.getAudioFileChecker('input/test_mono.wav','wav')
return a.isMono()
def test_mp3_mono() -> bool:
a = afcf.getAudioFileChecker('input/test_mono.mp3','mp3')
return a.isMono()
def test_wav_stereo() -> bool:
a = afcf.getAudioFileChecker('input/test_stereo.wav','wav')
return a.isStereo()
def test_wav_dual_mono() -> bool:
a = afcf.getAudioFileChecker('input/test_dualmono.wav','wav')
b = audio_file_exporter('test_dualmono_export.wav', a.getLeftChannel(), a.getSr(), 'output/')
b.export()
return a.isDualMono()
def test_mp3_dual_mono() -> bool:
a = afcf.getAudioFileChecker('input/test_dualmono.mp3','mp3')
return a.isDualMono()
def run_tests():
#assert test_wav_mono(), f"file was not read as mono"
#assert test_mp3_mono(), f"file was not read as mono"
#assert test_wav_stereo(), f"file was not read as stereo"
#assert test_mp3_dual_mono(), f"file was not read as dual mono"
#assert test_wav_dual_mono(), f"file was not read as dual mono"
print ("all tests ran correctly")
def run_generic_test():
conv = dual_mono_converter('input/', 'output/')
result = conv.convert()
print(result)
run_generic_test()