From b0a4454f0d012ba0c20d2aaf161e245f1d3aac29 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Tue, 7 Nov 2023 17:26:09 -0800 Subject: [PATCH] Added unit test for __main__ --- tests/test_main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/test_main.py diff --git a/tests/test_main.py b/tests/test_main.py new file mode 100644 index 0000000..d6d0ef9 --- /dev/null +++ b/tests/test_main.py @@ -0,0 +1,17 @@ +import unittest + +from unittest.mock import patch + +from wavinfo.__main__ import main + +import sys + +class MainTest(unittest.TestCase): + + def test_empty_argv(self): + with patch.object(sys, 'argv', []): + try: + main() + except: + self.fail("main() throwing an exception") +