mirror of
https://github.com/iluvcapra/wavinfo.git
synced 2025-12-31 17:00:41 +00:00
Added more main tests
This commit is contained in:
@@ -5,6 +5,7 @@ from unittest.mock import patch
|
|||||||
from wavinfo.__main__ import main
|
from wavinfo.__main__ import main
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import glob
|
||||||
|
|
||||||
class MainTest(unittest.TestCase):
|
class MainTest(unittest.TestCase):
|
||||||
|
|
||||||
@@ -15,3 +16,18 @@ class MainTest(unittest.TestCase):
|
|||||||
except:
|
except:
|
||||||
self.fail("main() throwing an exception")
|
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', [path]):
|
||||||
|
try:
|
||||||
|
main()
|
||||||
|
except:
|
||||||
|
self.fail("main() throwing an exception")
|
||||||
|
|
||||||
|
def test_ixml(self):
|
||||||
|
with patch.object(sys, 'argv',
|
||||||
|
['tests/test_files/sounddevices/A101_1.WAV']):
|
||||||
|
try:
|
||||||
|
main()
|
||||||
|
except:
|
||||||
|
self.fail("main() throwing an exception")
|
||||||
|
|||||||
Reference in New Issue
Block a user