python: tests: improve comments for auth silo and policy tests
authorRob van der Linde <rob@catalyst.net.nz>
Wed, 25 Oct 2023 22:18:04 +0000 (11:18 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 26 Oct 2023 23:32:34 +0000 (23:32 +0000)
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>
python/samba/tests/samba_tool/domain_auth_base.py
python/samba/tests/samba_tool/domain_auth_policy.py
python/samba/tests/samba_tool/domain_auth_silo.py

index 2bf619c7bd9cb1962be4cffe3a123268699daf4e..7d1e13393b0772bdb6d681ba2c80688b6ef06a90 100644 (file)
@@ -46,7 +46,7 @@ class BaseAuthCmdTest(SambaToolCmdTest):
 
         cls.create_authentication_silo(
             name="Developers",
-            description="Developers, Developers",
+            description="Developers, Developers, Developers!",
             user_authentication_policy="User Policy")
         cls.create_authentication_silo(
             name="Managers",
index 1d7079c78c4c94bf05622b9a333d442d9b0059d4..b0bfdded7e2adb840b915f4bd6ba4e03c60087df 100644 (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)
 
index 59f5c27963304cfaced3a6daf8a1e706bf41597f..b9d2e96e4eca75c9201300a1f75eed6e760f9b48 100644 (file)
@@ -71,7 +71,8 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest):
 
         # check a few fields only
         self.assertEqual(silo["cn"], "Developers")
-        self.assertEqual(silo["description"], "Developers, Developers")
+        self.assertEqual(silo["description"],
+                         "Developers, Developers, Developers!")
 
     def test_view__notfound(self):
         """Test viewing an authentication silo that doesn't exist."""
@@ -412,10 +413,12 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest):
                                        "--user-authentication-policy", "User Policy",
                                        "--protect")
         self.assertIsNone(result, msg=err)
+
+        # Silo exists
         silo = self.get_authentication_silo("deleteForceFail")
         self.assertIsNotNone(silo)
 
-        # 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")
@@ -434,6 +437,8 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest):
                                        "--name=regularSilo",
                                        "--user-authentication-policy", "User Policy")
         self.assertIsNone(result, msg=err)
+
+        # Silo exists
         silo = self.get_authentication_silo("regularSilo")
         self.assertIsNotNone(silo)
 
@@ -458,6 +463,8 @@ class AuthSiloCmdTestCase(BaseAuthCmdTest):
                                        "--user-authentication-policy", "User Policy",
                                        "--protect")
         self.assertIsNone(result, msg=err)
+
+        # Silo exists
         silo = self.get_authentication_silo("protectedSilo")
         self.assertIsNotNone(silo)