]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Improve indentation of t_otp.py
authorMichael Mattioli <mattiolimichael@gmail.com>
Tue, 15 Jul 2014 16:48:58 +0000 (12:48 -0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 15 Jul 2014 18:36:51 +0000 (14:36 -0400)
Move the RADIUS attribute dictionary text to a global variable defined
at indent level 0, so that we don't go back to indent level 0 in the
middle of the RadiusDaemon class definition.

[ghudson@mit.edu: clarified commit message, moved comment, changed
variable name]

src/tests/t_otp.py

index 0aeb692e46dabae4fb6715b77150e41d30f2f198..e114f03b9d2c20a9f5b30c8b0bea3ddfc159038e 100644 (file)
@@ -42,16 +42,17 @@ except ImportError:
     success('Warning: skipping OTP tests due to missing pyrad or old Python')
     exit(0)
 
-class RadiusDaemon(Process):
-    MAX_PACKET_SIZE = 4096
-
-    # We could use a dictionary file, but since we need
-    # such few attributes, we'll just include them here
-    DICTIONARY = dictionary.Dictionary(StringIO.StringIO("""
+# We could use a dictionary file, but since we need so few attributes,
+# we'll just include them here.
+radius_attributes = '''
 ATTRIBUTE    User-Name    1    string
 ATTRIBUTE    User-Password   2    string
 ATTRIBUTE    NAS-Identifier  32    string
-"""))
+'''
+
+class RadiusDaemon(Process):
+    MAX_PACKET_SIZE = 4096
+    DICTIONARY = dictionary.Dictionary(StringIO.StringIO(radius_attributes))
 
     def listen(self, addr):
         raise NotImplementedError()