krb5 commit: Improve indentation of t_otp.py
Greg Hudson
ghudson at MIT.EDU
Tue Jul 15 14:54:51 EDT 2014
https://github.com/krb5/krb5/commit/0db9cc6b01f979089aca324cccca7ee8cff62dc3
commit 0db9cc6b01f979089aca324cccca7ee8cff62dc3
Author: Michael Mattioli <mattiolimichael at gmail.com>
Date: Tue Jul 15 12:48:58 2014 -0400
Improve indentation of t_otp.py
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 at mit.edu: clarified commit message, moved comment, changed
variable name]
src/tests/t_otp.py | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/tests/t_otp.py b/src/tests/t_otp.py
index 0aeb692..e114f03 100644
--- a/src/tests/t_otp.py
+++ b/src/tests/t_otp.py
@@ -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()
More information about the cvs-krb5
mailing list