1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-23 00:23:53 +03:00

python: tests: improve comments for auth silo and policy tests

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Rob van der Linde
2023-10-26 11:18:04 +13:00
committed by Andrew Bartlett
parent 95cb6a0bb1
commit 2dd06ae41a
3 changed files with 17 additions and 4 deletions

View File

@@ -636,10 +636,12 @@ class AuthPolicyCmdTestCase(BaseAuthCmdTest):
"--name=deleteForceFail",
"--protect")
self.assertIsNone(result, msg=err)
# Policy exists
policy = self.get_authentication_policy("deleteForceFail")
self.assertIsNotNone(policy)
# Try delete with --force.
# Try doing delete with --force.
# Patch SDUtils.dacl_delete_aces with a Mock that raises ModelError.
with patch.object(SDUtils, "dacl_delete_aces") as delete_mock:
delete_mock.side_effect = ModelError("Custom error message")
@@ -657,6 +659,8 @@ class AuthPolicyCmdTestCase(BaseAuthCmdTest):
result, out, err = self.runcmd("domain", "auth", "policy", "create",
"--name=regularPolicy")
self.assertIsNone(result, msg=err)
# Policy exists
policy = self.get_authentication_policy("regularPolicy")
self.assertIsNotNone(policy)
@@ -680,6 +684,8 @@ class AuthPolicyCmdTestCase(BaseAuthCmdTest):
"--name=protectedPolicy",
"--protect")
self.assertIsNone(result, msg=err)
# Policy exists
policy = self.get_authentication_policy("protectedPolicy")
self.assertIsNotNone(policy)