[MERGE] [0.11] Working bzr+ssh://, make "bzr serve --inet" read-only by default.

Andrew Bennetts andrew at canonical.com
Tue Sep 19 04:05:04 BST 2006


Andrew Bennetts wrote:
> John Arbash Meinel wrote:
> > Andrew Bennetts wrote:
[...]
> 
> > Also, it would probably be better to have the StubSSHServer not defined
> > inside the test function, so that it could be accessed by other tests in
> > the future.
> 
> That would be nice, but it's awkward.  StubSSHServer needs paramiko to be
> present, and it needs a reference to the test case.  So it'd need to be guarded
> from ImportErrors (not needed inside the test method, because it will raise
> TestSkipped).  Also, it needs a reference to the test case to stash the
> command_executed value, and despite the 'test_case' parameter in its __init__,
> it's actually passed an SFTPServer when constructed.  Oh, I guess I can use
> 'logs' attribute of SFTPServer instead.
> 
> Ok, I've made that change.

Actually, I'm changing my mind -- we don't want this to be re-used.  This is
just a single blackbox test, and we really shouldn't need any others that run up
an actual SSH server, connect to it, and execute a bzr process through it.
Other tests for smart server-related functionality should be testing much
smaller units.  Ditto for testing the 'connect_ssh' methods.

Given that moving it to a global had a small negative impact on the test
readability, (the assertion about command_executed wasn't as clear, as I had to
filter the ssh_server.logs, and the alternative approaches I considered weren't
significantly better) I'm leaving it as a local.

-Andrew.





More information about the bazaar mailing list