]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/auth_log: Rename ‘self’ parameter to ‘cls’
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 23 May 2023 02:57:47 +0000 (14:57 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 24 May 2023 00:50:31 +0000 (00:50 +0000)
This method operates on the class, not on an instance of the class.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/auth_log_base.py

index 6f11a7e883df330cc33c6090d3219626fbc61c05..2f9b13e4f445fa3bc08b4b6b6e1473699a211aac 100644 (file)
@@ -31,7 +31,7 @@ import re
 class AuthLogTestBase(samba.tests.TestCase):
 
     @classmethod
-    def setUpClass(self):
+    def setUpClass(cls):
         super().setUpClass()
 
         # connect to the server's messaging bus (we need to explicitly load a
@@ -42,8 +42,8 @@ class AuthLogTestBase(samba.tests.TestCase):
             lp_ctx = LoadParm(filename_for_non_global_lp=server_conf)
         else:
             samba.tests.env_loadparm()
-        self.msg_ctx = Messaging((1,), lp_ctx=lp_ctx)
-        self.msg_ctx.irpc_add_name(AUTH_EVENT_NAME)
+        cls.msg_ctx = Messaging((1,), lp_ctx=lp_ctx)
+        cls.msg_ctx.irpc_add_name(AUTH_EVENT_NAME)
 
         # Now switch back to using the client-side smb.conf. The tests will
         # use the first interface in the client.conf (we need to strip off
@@ -54,7 +54,7 @@ class AuthLogTestBase(samba.tests.TestCase):
 
         # the messaging ctx is the server's view of the world, so our own
         # client IP will be the remoteAddress when connections are logged
-        self.remoteAddress = client_ip
+        cls.remoteAddress = client_ip
 
         def messageHandler(context, msgType, src, message):
             # This does not look like sub unit output and it
@@ -63,13 +63,13 @@ class AuthLogTestBase(samba.tests.TestCase):
             jsonMsg = json.loads(message)
             context["messages"].append(jsonMsg)
 
-        self.context = {"messages": []}
-        self.msg_handler_and_context = (messageHandler, self.context)
-        self.msg_ctx.register(self.msg_handler_and_context,
-                              msg_type=MSG_AUTH_LOG)
+        cls.context = {"messages": []}
+        cls.msg_handler_and_context = (messageHandler, cls.context)
+        cls.msg_ctx.register(cls.msg_handler_and_context,
+                             msg_type=MSG_AUTH_LOG)
 
-        self.server = os.environ["SERVER"]
-        self.connection = None
+        cls.server = os.environ["SERVER"]
+        cls.connection = None
 
     @classmethod
     def tearDownClass(self):