Rev 2486: Add a test for create_branch_convenience. Mark some places to test for multiple connections. in file:///v/home/vila/src/bugs/111702/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri May 4 11:26:45 BST 2007


At file:///v/home/vila/src/bugs/111702/

------------------------------------------------------------
revno: 2486
revision-id: v.ladeuil+lp at free.fr-20070504102643-3qbwrvmvzjildjez
parent: v.ladeuil+lp at free.fr-20070503212944-naxq1qsq297uxauz
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 111702
timestamp: Fri 2007-05-04 12:26:43 +0200
message:
  Add a test for create_branch_convenience. Mark some places to test for multiple connections.
modified:
  bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
  bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
  bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
  bzrlib/transport/sftp.py       sftp.py-20051019050329-ab48ce71b7e32dfe
-------------- next part --------------
=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py	2007-05-03 21:27:14 +0000
+++ b/bzrlib/tests/test_bzrdir.py	2007-05-04 10:26:43 +0000
@@ -288,7 +288,7 @@
 
     def test_create_branch_and_repo_uses_default(self):
         format = SampleBzrDirFormat()
-        branch = bzrdir.BzrDir.create_branch_and_repo(self.get_url(), 
+        branch = bzrdir.BzrDir.create_branch_and_repo(self.get_url(),
                                                       format=format)
         self.assertTrue(isinstance(branch, SampleBranch))
 
@@ -343,6 +343,15 @@
         branch.bzrdir.open_workingtree()
         branch.bzrdir.open_repository()
 
+    def test_create_branch_convenience_possible_transports(self):
+        """Check that the optional 'possible_transports' is recognized"""
+        format = bzrdir.format_registry.make_bzrdir('knit')
+        t = self.get_transport()
+        branch = bzrdir.BzrDir.create_branch_convenience(
+            '.', format=format, possible_transports=[t])
+        branch.bzrdir.open_workingtree()
+        branch.bzrdir.open_repository()
+
     def test_create_branch_convenience_root(self):
         """Creating a branch at the root of a fs should work."""
         self.vfs_transport_factory = MemoryServer

=== modified file 'bzrlib/transport/ftp.py'
--- a/bzrlib/transport/ftp.py	2007-04-18 14:06:46 +0000
+++ b/bzrlib/transport/ftp.py	2007-05-04 10:26:43 +0000
@@ -69,6 +69,7 @@
         mutter("Constructing FTP instance against %r" % (alt_key,))
         conn = ftplib.FTP()
 
+        # FIXME: instrument or refactor to allow testing for mutiple connections
         conn.connect(host=hostname, port=port)
         if username and username != 'anonymous' and not password:
             password = bzrlib.ui.ui_factory.get_password(

=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py'
--- a/bzrlib/transport/http/_urllib2_wrappers.py	2007-05-03 21:27:14 +0000
+++ b/bzrlib/transport/http/_urllib2_wrappers.py	2007-05-04 10:26:43 +0000
@@ -235,7 +235,7 @@
 
     handler_order = 1000 # after all pre-processings
 
-    # test mutiple connections
+    # FIXME: instrument or refactor to allow testing for mutiple connections
     def create_connection(self, request, http_connection_class):
         host = request.get_host()
         if not host:

=== modified file 'bzrlib/transport/sftp.py'
--- a/bzrlib/transport/sftp.py	2007-05-03 21:27:14 +0000
+++ b/bzrlib/transport/sftp.py	2007-05-04 10:26:43 +0000
@@ -824,7 +824,7 @@
         # that we have taken the lock.
         return SFTPLock(relpath, self)
 
-    # test mutiple connections
+    # FIXME: instrument or refactor to allow testing for mutiple connections
     def _sftp_connect(self):
         """Connect to the remote sftp server.
         After this, self._sftp should have a valid connection (or



More information about the bazaar-commits mailing list