From 7e0b72849805a952779d3b555108e673a7ec8ebe Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 13 Dec 2022 12:08:09 -0800 Subject: [PATCH] users: tests: Fix privileged tests Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/users/tests/test_privileged.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plinth/modules/users/tests/test_privileged.py b/plinth/modules/users/tests/test_privileged.py index 268a48aba..0852b01f9 100644 --- a/plinth/modules/users/tests/test_privileged.py +++ b/plinth/modules/users/tests/test_privileged.py @@ -246,7 +246,7 @@ def test_change_other_users_password_as_non_admin(): username2, _ = _create_user() new_password = 'pass $123' - with pytest.raises(subprocess.CalledProcessError): + with pytest.raises(PermissionError): privileged.set_user_password(username2, new_password, username1, password1) @@ -326,8 +326,7 @@ def test_groups(): groupname = _random_string() _create_group(groupname) - with pytest.raises(subprocess.CalledProcessError): - subprocess.run(['ldapgid', groupname], check=True) + subprocess.run(['ldapgid', groupname], check=True) # create-group is idempotent privileged.create_group(groupname)