Skip to content

Commit

Permalink
umu_test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Nov 29, 2024
1 parent d9e95b1 commit 850a753
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion umu/umu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
):
Expand Down

0 comments on commit 850a753

Please sign in to comment.