Rev 5013: Fix per_branch/test_bound_sftp.py imports. in file:///home/vila/src/bzr/cleanup/test-imports/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Feb 5 13:35:16 GMT 2010


At file:///home/vila/src/bzr/cleanup/test-imports/

------------------------------------------------------------
revno: 5013
revision-id: v.ladeuil+lp at free.fr-20100205133516-g3d7pswy35ayw0ik
parent: v.ladeuil+lp at free.fr-20100205132925-cbn391q4ld595am3
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: test-imports
timestamp: Fri 2010-02-05 14:35:16 +0100
message:
  Fix per_branch/test_bound_sftp.py imports.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_branch/test_bound_sftp.py'
--- a/bzrlib/tests/per_branch/test_bound_sftp.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/per_branch/test_bound_sftp.py	2010-02-05 13:35:16 +0000
@@ -19,27 +19,20 @@
 
 import os
 
-import bzrlib
 from bzrlib import (
+    branch,
     bzrdir,
+    errors,
+    tests,
     )
-from bzrlib.branch import Branch
-from bzrlib.bzrdir import (BzrDir,
-                           BzrDirFormat,
-                           BzrDirFormat6,
-                           BzrDirMetaFormat1,
-                           )
-import bzrlib.errors as errors
-from bzrlib.tests import TestSkipped
-from bzrlib.tests import TestCaseWithTransport
 from bzrlib.transport.local import LocalURLServer
 from bzrlib.transport.memory import MemoryServer
 
 
-class BoundSFTPBranch(TestCaseWithTransport):
+class BoundSFTPBranch(tests.TestCaseWithTransport):
 
     def setUp(self):
-        TestCaseWithTransport.setUp(self)
+        tests.TestCaseWithTransport.setUp(self)
         self.vfs_transport_factory = MemoryServer
         if self.transport_server is LocalURLServer:
             self.transport_server = None
@@ -48,10 +41,10 @@
         self.build_tree(['base/', 'base/a', 'base/b'])
         format = bzrdir.format_registry.make_bzrdir('knit')
         try:
-            wt_base = BzrDir.create_standalone_workingtree(
+            wt_base = bzrdir.BzrDir.create_standalone_workingtree(
                 self.get_url('base'), format=format)
         except errors.NotLocalUrl:
-            raise TestSkipped('Not a local URL')
+            raise tests.TestSkipped('Not a local URL')
 
         b_base = wt_base.branch
 
@@ -60,7 +53,7 @@
         wt_base.commit('first', rev_id='r at b-1')
 
         wt_child = b_base.bzrdir.sprout('child').open_workingtree()
-        self.sftp_base = Branch.open(self.get_url('base'))
+        self.sftp_base = branch.Branch.open(self.get_url('base'))
         wt_child.branch.bind(self.sftp_base)
         # check the branch histories are ready for using in tests.
         self.assertEqual(['r at b-1'], b_base.revision_history())
@@ -70,9 +63,10 @@
     def test_simple_binding(self):
         self.build_tree(['base/', 'base/a', 'base/b', 'child/'])
         try:
-            wt_base = BzrDir.create_standalone_workingtree(self.get_url('base'))
+            wt_base = bzrdir.BzrDir.create_standalone_workingtree(
+                self.get_url('base'))
         except errors.NotLocalUrl:
-            raise TestSkipped('Not a local URL')
+            raise tests.TestSkipped('Not a local URL')
 
         wt_base.add('a')
         wt_base.add('b')
@@ -83,11 +77,12 @@
         # may not be bindable-from, and we want to test the side effects etc
         # of bondage.
         format = bzrdir.format_registry.make_bzrdir('knit')
-        b_child = BzrDir.create_branch_convenience('child', format=format)
+        b_child = bzrdir.BzrDir.create_branch_convenience(
+            'child', format=format)
         self.assertEqual(None, b_child.get_bound_location())
         self.assertEqual(None, b_child.get_master_branch())
 
-        sftp_b_base = Branch.open(self.get_url('base'))
+        sftp_b_base = branch.Branch.open(self.get_url('base'))
         b_child.bind(sftp_b_base)
         self.assertEqual(sftp_b_base.base, b_child.get_bound_location())
         # the bind must not have given b_child history:
@@ -125,7 +120,7 @@
         self.assertRaises(errors.BoundBranchOutOfDate,
                 wt_child.commit, 'child', rev_id='r at c-2')
 
-        sftp_b_base = Branch.open(self.get_url('base'))
+        sftp_b_base = branch.Branch.open(self.get_url('base'))
 
         # This is all that cmd_update does
         wt_child.pull(sftp_b_base, overwrite=False)
@@ -170,7 +165,7 @@
         self.assertEqual(['r at b-1', 'r at c-2'], wt_child.branch.revision_history())
         self.assertEqual(['r at b-1', 'r at b-2'], b_base.revision_history())
 
-        sftp_b_base = Branch.open(self.get_url('base'))
+        sftp_b_base = branch.Branch.open(self.get_url('base'))
         self.assertRaises(errors.DivergedBranches,
                 wt_child.branch.bind, sftp_b_base)
 
@@ -181,8 +176,8 @@
 
         b_base.bzrdir.sprout('newbase')
 
-        sftp_b_base = Branch.open(self.get_url('base'))
-        sftp_b_newbase = Branch.open(self.get_url('newbase'))
+        sftp_b_base = branch.Branch.open(self.get_url('base'))
+        sftp_b_newbase = branch.Branch.open(self.get_url('newbase'))
 
         sftp_b_base.bind(sftp_b_newbase)
 
@@ -208,7 +203,7 @@
         b_base.bzrdir.open_workingtree().commit('base', rev_id='r at b-2')
         self.assertEqual(['r at b-1', 'r at b-2'], b_base.revision_history())
 
-        sftp_b_base = Branch.open(self.get_url('base'))
+        sftp_b_base = branch.Branch.open(self.get_url('base'))
 
         self.assertRaises(errors.DivergedBranches,
                 wt_child.branch.bind, sftp_b_base)
@@ -236,7 +231,7 @@
         self.assertEqual(['r at b-1', 'r at b-2'], b_base.revision_history())
         self.assertEqual(['r at b-1'], wt_child.branch.revision_history())
 
-        sftp_b_base = Branch.open(self.get_url('base'))
+        sftp_b_base = branch.Branch.open(self.get_url('base'))
         wt_child.branch.bind(sftp_b_base)
 
         self.assertEqual(['r at b-1'], wt_child.branch.revision_history())
@@ -265,7 +260,7 @@
         self.assertEqual(['r at b-1', 'r at c-2'], wt_child.branch.revision_history())
         self.assertEqual(['r at b-1'], b_base.revision_history())
 
-        sftp_b_base = Branch.open(self.get_url('base'))
+        sftp_b_base = branch.Branch.open(self.get_url('base'))
         wt_child.branch.bind(sftp_b_base)
 
         self.assertEqual(['r at b-1'], b_base.revision_history())



More information about the bazaar-commits mailing list