diff --git a/twisted/conch/ssh/userauth.py b/twisted/conch/ssh/userauth.py
|
a
|
b
|
|
| 836 | 836 | MSG_USERAUTH_PK_OK = 60 |
| 837 | 837 | |
| 838 | 838 | messages = {} |
| 839 | | for k, v in locals().items(): |
| | 839 | # Sorting ensures MSG_USERAUTH_PK_OK comes last. |
| | 840 | for k, v in sorted(globals().items()): |
| 840 | 841 | if k[:4]=='MSG_': |
| 841 | 842 | messages[v] = k # doesn't handle doubles |
| 842 | 843 | |
diff --git a/twisted/conch/test/test_userauth.py b/twisted/conch/test/test_userauth.py
|
a
|
b
|
|
| 1060 | 1060 | def check(ignored): |
| 1061 | 1061 | self.assertEqual(server.transport.service.name, 'TestService') |
| 1062 | 1062 | return d.addCallback(check) |
| | 1063 | |
| | 1064 | |
| | 1065 | |
| | 1066 | class ModuleInitializationTestCase(unittest.TestCase): |
| | 1067 | |
| | 1068 | |
| | 1069 | def test_messages(self): |
| | 1070 | # Several message types have value 60, check that MSG_USERAUTH_PK_OK |
| | 1071 | # is always the one which is mapped. |
| | 1072 | self.assertEqual(userauth.SSHUserAuthServer.protocolMessages[60], |
| | 1073 | 'MSG_USERAUTH_PK_OK') |
| | 1074 | self.assertEqual(userauth.SSHUserAuthClient.protocolMessages[60], |
| | 1075 | 'MSG_USERAUTH_PK_OK') |