r47040 - fix twistedchecker
hawkowl-TA+aISz0psMTMxyoc4vAAJOcrHinNvQL0E9HWUfgJXw@public.gmane.org Sun, 20 Mar 2016 19:57:06 -0600 (MDT)
| Newsgroups | gmane.comp.python.twisted.commits |
|---|---|
| Message-ID | <[email protected]> |
Author: hawkowl
Date: Sun Mar 20 19:57:01 2016
New Revision: 47040
Modified:
branches/clarity-sshuserauth-8240/twisted/conch/test/test_userauth.py
Log:
fix twistedchecker
Modified: branches/clarity-sshuserauth-8240/twisted/conch/test/test_userauth.py
==============================================================================
--- branches/clarity-sshuserauth-8240/twisted/conch/test/test_userauth.py (original)
+++ branches/clarity-sshuserauth-8240/twisted/conch/test/test_userauth.py Sun Mar 20 19:57:01 2016
@@ -50,7 +50,6 @@
A mock user auth client.
"""
-
def getPublicKey(self):
"""
If this is the first time we've been called, return a blob for
@@ -60,7 +59,8 @@
if self.lastPublicKey:
return keys.Key.fromString(keydata.publicRSA_openssh)
else:
- return defer.succeed(keys.Key.fromString(keydata.publicDSA_openssh))
+ return defer.succeed(
+ keys.Key.fromString(keydata.publicDSA_openssh))
def getPrivateKey(self):
@@ -91,7 +91,6 @@
getPrivateKey() and a string from getPublicKey
"""
-
def getPrivateKey(self):
return defer.succeed(keys.Key.fromString(
keydata.privateRSA_openssh).keyObject)
@@ -107,7 +106,6 @@
This client doesn't have a private key, but it does have a public key.
"""
-
def getPrivateKey(self):
return
@@ -134,7 +132,6 @@
@type lostConnection: C{bool}
"""
-
class Service(object):
"""
A mock service, representing the other service offered by the server.
@@ -146,14 +143,12 @@
pass
-
class Factory(object):
"""
A mock factory, representing the factory that spawned this user auth
service.
"""
-
def getService(self, transport, service):
"""
Return our fake service.
@@ -162,7 +157,6 @@
return FakeTransport.Service
-
def __init__(self, portal):
self.factory = self.Factory()
self.factory.portal = portal
@@ -171,7 +165,6 @@
self.packets = []
-
def sendPacket(self, messageType, message):
"""
Record the packet sent by the service.
@@ -256,7 +249,6 @@
Tests for SSHUserAuthServer.
"""
-
if keys is None:
skip = "cannot run without cryptography"
@@ -307,7 +299,8 @@
See RFC 4252, Section 5.1.
"""
- packet = NS(b'foo') + NS(b'none') + NS(b'password') + chr(0) + NS(b'foo')
+ packet = b''.join([NS(b'foo'), NS(b'none'), NS(b'password'), chr(0),
+ NS(b'foo')])
d = self.authServer.ssh_USERAUTH_REQUEST(packet)
def check(ignored):
self.assertEqual(
@@ -326,7 +319,8 @@
See RFC 4252, Section 5.1.
"""
# packet = username, next_service, authentication type, FALSE, password
- packet = NS(b'foo') + NS(b'none') + NS(b'password') + chr(0) + NS(b'bar')
+ packet = b''.join([NS(b'foo'), NS(b'none'), NS(b'password'), chr(0),
+ NS(b'bar')])
self.authServer.clock = task.Clock()
d = self.authServer.ssh_USERAUTH_REQUEST(packet)
self.assertEqual(self.authServer.transport.packets, [])
@@ -527,7 +521,8 @@
Test that the server disconnects if the client fails authentication
too many times.
"""
- packet = NS(b'foo') + NS(b'none') + NS(b'password') + chr(0) + NS(b'bar')
+ packet = b''.join([NS(b'foo'), NS(b'none'), NS(b'password'), chr(0),
+ NS(b'bar')])
self.authServer.clock = task.Clock()
for i in range(21):
d = self.authServer.ssh_USERAUTH_REQUEST(packet)
@@ -578,7 +573,6 @@
-
class SSHUserAuthClientTests(unittest.TestCase):
"""
Tests for SSHUserAuthClient.
@@ -781,7 +775,8 @@
failed Deferred. getPassword() should return a failed Deferred.
getGenericAnswers() should return a failed Deferred.
"""
- authClient = userauth.SSHUserAuthClient(b'foo', FakeTransport.Service())
+ authClient = userauth.SSHUserAuthClient(b'foo',
+ FakeTransport.Service())
self.assertIs(authClient.getPublicKey(), None)
def check(result):
result.trap(NotImplementedError)
@@ -800,7 +795,6 @@
class LoopbackTests(unittest.TestCase):
-
if keys is None:
skip = "cannot run without cryptography or PyASN1"