[MERGE][157752] Wrap medusa test ftp server behind FTPServerFeature
John Arbash Meinel
john at arbash-meinel.com
Tue Oct 30 18:33:06 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Vincent Ladeuil wrote:
> I had mainly fixed it while working on bug #127164 where I want
> several lightly different ftp test servers, so the first step was
> to transfer the actual medusa ftp test server in its own file.
>
> I just had to create a dummy ftp server to make the test suite
> reports the actual tests skipped.
>
> Vincent
>
>
We generally try not to capitalize module names. Mostly because this causes
confusion like:
from bzrlib.tests import FTPServer
FTPServer.FTPServer ???
there are some files in tests/* that have CamelCase, but we moved away from that.
- - return [(FtpTransport, FtpServer)]
+ # Dummy server to have the test suite report the number of tests
+ # needing that feature.
+ class FTPServer(object):
+ def setUp(self):
+ raise tests.UnavailableFeature(tests.FTPServerFeature)
+
+ return [(FtpTransport, FTPServer)]
^- Please don't call the fake server (that always fails) the same as the one
that works. Either call it
FakeFTPServer
or
FailingFTPServer
etc.
So I would change those lines to:
if tests.FTPServerFeature.available():
from bzrlib.tests import ftp_server
return [(FtpTransport, ftp_server.FTPServer)]
else:
class UnavailableFTPServer(object):
def setUp(self):
raise tests.UnavailableFeature(tests.FTPServerFeature)
return [(FtpTransport, UnavailableFTPServer)]
Otherwise, if this was basically just a cut & paste job:
BB:tweak
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHJ3jiJdeBCYSNAAMRAkm0AJ0crKJStlwa64ERr4t9Ddko4sRATgCfb7x7
mZs6lStD8wJFMa4VIhyQEq8=
=I4RI
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list