From 850a75316d5db7be2944180774d9fc3792fbc764 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:11:29 -0800 Subject: [PATCH] umu_test: fix tests --- umu/umu_test.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/umu/umu_test.py b/umu/umu_test.py index 725f7a18..1e01a619 100644 --- a/umu/umu_test.py +++ b/umu/umu_test.py @@ -194,12 +194,24 @@ def tearDown(self): def test_main_nomusl(self): """Test __main__.main to ensure an exit when on a musl-based system.""" os.environ["LD_LIBRARY_PATH"] = f"{os.environ['LD_LIBRARY_PATH']}:musl" - with self.assertRaises(SystemExit): + with ( + patch.object( + __main__, + "parse_args", + return_value=["foo", "foo"], + ), + self.assertRaises(SystemExit), + ): __main__.main() def test_main_noroot(self): """Test __main__.main to ensure an exit when run as a privileged user.""" with ( + patch.object( + __main__, + "parse_args", + return_value=["foo", "foo"], + ), self.assertRaises(SystemExit), patch.object(os, "geteuid", return_value=0), ):