Added test file, Ruff pass

This commit is contained in:
2026-09-17 10:30:32 -07:00
parent e6320e84c6
commit f9de312610
23 changed files with 61 additions and 116 deletions
+8 -10
View File
@@ -1,28 +1,26 @@
import glob
import sys
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")
except Exception as e:
self.fail(f"main() throwing an exception: {e}")
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")
except Exception as e:
self.fail(f"main() throwing an exception: {e}")
def test_ixml(self):
with patch.object(
@@ -30,5 +28,5 @@ class MainTest(unittest.TestCase):
):
try:
main()
except:
self.fail("main() throwing an exception")
except Exception as e:
self.fail(f"main() throwing an exception: {e}")