Rev 2792: Review feedback. in file:///v/home/vila/src/bugs/137044/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Sep 5 14:35:41 BST 2007
At file:///v/home/vila/src/bugs/137044/
------------------------------------------------------------
revno: 2792
revision-id: v.ladeuil+lp at free.fr-20070905133538-3hlcjti8pktcamp0
parent: v.ladeuil+lp at free.fr-20070905072749-qiud9xt21loarqyy
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 137044
timestamp: Wed 2007-09-05 15:35:38 +0200
message:
Review feedback.
modified:
bzrlib/tests/test_ftp_transport.py test_aftp_transport.-20060823221619-98mwjzxtwtkt527k-1
bzrlib/transport/ftp.py ftp.py-20051116161804-58dc9506548c2a53
-------------- next part --------------
=== modified file 'bzrlib/tests/test_ftp_transport.py'
--- a/bzrlib/tests/test_ftp_transport.py 2007-09-05 07:27:49 +0000
+++ b/bzrlib/tests/test_ftp_transport.py 2007-09-05 13:35:38 +0000
@@ -16,19 +16,14 @@
import sys
-from bzrlib import ui
-from bzrlib.tests import (
- Feature,
- TestCaseWithTransport,
- TestUIFactory,
- )
-from bzrlib.tests import (
- StringIOWrapper,
- )
-import bzrlib.transport
-
-
-class _MedusaFeature(Feature):
+from bzrlib import (
+ tests,
+ transport,
+ ui,
+ )
+
+
+class _MedusaFeature(tests.Feature):
"""Some tests want an FTP Server, check if one is available.
Right now, the only way this is available is if 'medusa' is installed.
@@ -49,7 +44,7 @@
MedusaFeature = _MedusaFeature()
-class TestCaseWithFTPServer(TestCaseWithTransport):
+class TestCaseWithFTPServer(tests.TestCaseWithTransport):
_test_needs_features = [MedusaFeature]
@@ -60,11 +55,11 @@
-class TestCaseAFTP(TestCaseWithTransport):
+class TestCaseAFTP(tests.TestCaseWithTransport):
"""Test aftp transport."""
def test_aftp_degrade(self):
- t = bzrlib.transport.get_transport('aftp://host/path')
+ t = transport.get_transport('aftp://host/path')
self.failUnless(t.is_active)
parent = t.clone('..')
self.failUnless(parent.is_active)
@@ -93,7 +88,7 @@
# for debugging purposes but leave them in place, there are needed to
# run the tests without any console
self.old_stdout = sys.stdout
- sys.stdout = StringIOWrapper()
+ sys.stdout = tests.StringIOWrapper()
self.addCleanup(self.restoreUIFactory)
def restoreUIFactory(self):
@@ -108,7 +103,7 @@
# reset it to None in the transport before the connection).
password = t._password
t._password = None
- ui.ui_factory = TestUIFactory(stdin=password+'\n')
+ ui.ui_factory = tests.TestUIFactory(stdin=password+'\n')
# Ask the server to check the password
server = self.get_server()
# FIXME: There should be a better way to declare authorized users and
=== modified file 'bzrlib/transport/ftp.py'
--- a/bzrlib/transport/ftp.py 2007-09-05 07:27:49 +0000
+++ b/bzrlib/transport/ftp.py 2007-09-05 13:35:38 +0000
@@ -651,9 +651,9 @@
channel.read_only = 0
# Only 'foo' user is allowed for the tests
- if self.secured_user is not None \
- and username == self.secured_user \
- and password != self.secured_password:
+ if (self.secured_user is not None
+ and username == self.secured_user
+ and password != self.secured_password):
return 0, 'Password invalid.', None
else:
return 1, 'OK.', medusa.filesys.os_filesystem(self.root)
More information about the bazaar-commits
mailing list