mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 17:00:41 +00:00
34 lines
892 B
Python
34 lines
892 B
Python
import unittest
|
|
|
|
from unittest.mock import patch
|
|
|
|
from wavinfo.__main__ import main
|
|
|
|
import sys
|
|
import glob
|
|
|
|
class MainTest(unittest.TestCase):
|
|
|
|
def test_empty_argv(self):
|
|
with patch.object(sys, 'argv', []):
|
|
try:
|
|
main()
|
|
except:
|
|
self.fail("main() throwing an exception")
|
|
|
|
def test_a_file(self):
|
|
for path in glob.glob("tests/test_files/**/*.wav"):
|
|
with patch.object(sys, 'argv', ["TEST", path]):
|
|
try:
|
|
main()
|
|
except:
|
|
self.fail("main() throwing an exception")
|
|
|
|
def test_ixml(self):
|
|
with patch.object(sys, 'argv',
|
|
['TEST', 'tests/test_files/sounddevices/A101_1.WAV']):
|
|
try:
|
|
main()
|
|
except:
|
|
self.fail("main() throwing an exception")
|