[Checkins] SVN: zope.app.fssync/branches/achapman-tests-pass/ - make buildable
Alex Chapman
achapman at zope.com
Fri Jul 23 17:18:42 EDT 2010
Log message for revision 114969:
- make buildable
- make tests pass
Changed:
U zope.app.fssync/branches/achapman-tests-pass/buildout.cfg
U zope.app.fssync/branches/achapman-tests-pass/src/zope/app/fssync/tests/ssh.txt
-=-
Modified: zope.app.fssync/branches/achapman-tests-pass/buildout.cfg
===================================================================
--- zope.app.fssync/branches/achapman-tests-pass/buildout.cfg 2010-07-23 21:17:04 UTC (rev 114968)
+++ zope.app.fssync/branches/achapman-tests-pass/buildout.cfg 2010-07-23 21:18:41 UTC (rev 114969)
@@ -8,6 +8,7 @@
use-dependency-links = false
[versions]
+zope.fssync = 3.5.1
paramiko = 1.7.4
pycrypto = 2.0.1
Modified: zope.app.fssync/branches/achapman-tests-pass/src/zope/app/fssync/tests/ssh.txt
===================================================================
--- zope.app.fssync/branches/achapman-tests-pass/src/zope/app/fssync/tests/ssh.txt 2010-07-23 21:17:04 UTC (rev 114968)
+++ zope.app.fssync/branches/achapman-tests-pass/src/zope/app/fssync/tests/ssh.txt 2010-07-23 21:18:41 UTC (rev 114969)
@@ -63,16 +63,40 @@
requires lots of stuff like having ssh agent running, host keys, and
having an ssh server running. For now let's just do what we can.
+We need to make a stub paramiko.SSHClient for this to work correctly.
+
+ >>> import paramiko
+ >>> old_pclient = paramiko.SSHClient
+ >>> class new_pclient(object):
+ ... def set_missing_host_key_policy(self, policy):
+ ... self.policy = policy
+ ...
+ ... def load_system_host_keys(self, keys):
+ ... self.keys = keys
+ ...
+ ... def load_host_keys(self, key_fn):
+ ... pass
+ ...
+ ... def connect(self, host, port, remote_user_name):
+ ... pass
+
+ >>> paramiko.SSHClient = new_pclient
+
>>> from zope.app.fssync.ssh import SSHConnection
>>> c = SSHConnection('localhost:12345')
>>> c.putrequest('GET', '/')
Traceback (most recent call last):
- ...
- error: (111, 'Connection refused')
+ ...
+ AttributeError: 'new_pclient' object has no attribute 'get_transport'
We get an error here because we're not running an ssh server on port
12345.
+ >>> paramiko.SSHClient = old_pclient
+ >>> new_client = paramiko.SSHClient()
+ >>> c.client.set_missing_host_key_policy(c.client.policy)
+ >>> c.client.load_system_host_keys(c.client.keys)
+
Even though we don't have a real encrypted network connection, let's
see what the connection object would send over the ssh channel.
>>> class StubFile(object):
More information about the checkins
mailing list