users: tests: Fix privileged tests

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-12-13 12:08:09 -08:00 committed by James Valleroy
parent aa2992b826
commit 7e0b728498
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -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)