Rev 5612: Use self.get_transport() in per_controldir_colo and some cleanup. in file:///home/vila/src/bzr/reviews/2.3_qualified_get_transport/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Thu Jan 27 13:58:35 UTC 2011
At file:///home/vila/src/bzr/reviews/2.3_qualified_get_transport/
------------------------------------------------------------
revno: 5612
revision-id: v.ladeuil+lp at free.fr-20110127135835-rzvxbce5vx3kn9zj
parent: gzlist at googlemail.com-20110126193507-j3mng0trvm0dwdju
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 2.3_qualified_get_transport
timestamp: Thu 2011-01-27 14:58:35 +0100
message:
Use self.get_transport() in per_controldir_colo and some cleanup.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_controldir/__init__.py'
--- a/bzrlib/tests/per_controldir/__init__.py 2010-08-27 17:53:08 +0000
+++ b/bzrlib/tests/per_controldir/__init__.py 2011-01-27 13:58:35 +0000
@@ -35,7 +35,7 @@
def make_scenarios(vfs_factory, transport_server, transport_readonly_server,
- formats, name_suffix=''):
+ formats, name_suffix=''):
"""Transform the input to a list of scenarios.
:param formats: A list of bzrdir_format objects.
=== modified file 'bzrlib/tests/per_controldir_colo/test_supported.py'
--- a/bzrlib/tests/per_controldir_colo/test_supported.py 2011-01-26 19:34:58 +0000
+++ b/bzrlib/tests/per_controldir_colo/test_supported.py 2011-01-27 13:58:35 +0000
@@ -19,25 +19,22 @@
import bzrlib.branch
from bzrlib import (
errors,
+ tests,
transport,
)
from bzrlib.tests import (
- TestNotApplicable,
- )
-
-from bzrlib.tests.per_controldir_colo import (
- TestCaseWithControlDir,
- )
-
-
-class TestColocatedBranchSupport(TestCaseWithControlDir):
+ per_controldir,
+ )
+
+
+class TestColocatedBranchSupport(per_controldir.TestCaseWithControlDir):
def test_destroy_colocated_branch(self):
branch = self.make_branch('branch')
bzrdir = branch.bzrdir
colo_branch = bzrdir.create_branch('colo')
bzrdir.destroy_branch("colo")
- self.assertRaises(errors.NotBranchError, bzrdir.open_branch,
+ self.assertRaises(errors.NotBranchError, bzrdir.open_branch,
"colo")
def test_create_colo_branch(self):
@@ -46,13 +43,13 @@
# unsupported formats are not loopback testable
# because the default open will not open them and
# they may not be initializable.
- raise TestNotApplicable('Control dir format not supported')
- t = transport.get_transport(self.get_url())
+ raise tests.TestNotApplicable('Control dir format not supported')
+ t = self.get_transport()
try:
made_control = self.bzrdir_format.initialize(t.base)
except errors.UninitializableFormat:
- raise TestNotApplicable('Control dir does not support creating '
- 'new branches.')
+ raise tests.TestNotApplicable(
+ 'Control dir does not support creating new branches.')
made_repo = made_control.create_repository()
made_branch = made_control.create_branch("colo")
self.failUnless(isinstance(made_branch, bzrlib.branch.Branch))
=== modified file 'bzrlib/tests/per_controldir_colo/test_unsupported.py'
--- a/bzrlib/tests/per_controldir_colo/test_unsupported.py 2011-01-26 19:34:58 +0000
+++ b/bzrlib/tests/per_controldir_colo/test_unsupported.py 2011-01-27 13:58:35 +0000
@@ -22,18 +22,15 @@
from bzrlib import (
errors,
+ tests,
transport,
)
from bzrlib.tests import (
- TestNotApplicable,
- )
-
-from bzrlib.tests.per_controldir_colo import (
- TestCaseWithControlDir,
- )
-
-
-class TestNoColocatedSupport(TestCaseWithControlDir):
+ per_controldir,
+ )
+
+
+class TestNoColocatedSupport(per_controldir.TestCaseWithControlDir):
def make_bzrdir_with_repo(self):
# a bzrdir can construct a branch and repository for itself.
@@ -41,8 +38,8 @@
# unsupported formats are not loopback testable
# because the default open will not open them and
# they may not be initializable.
- raise TestNotApplicable('Control dir format not supported')
- t = transport.get_transport(self.get_url())
+ raise tests.TestNotApplicable('Control dir format not supported')
+ t = self.get_transport()
made_control = self.bzrdir_format.initialize(t.base)
made_repo = made_control.create_repository()
return made_control
More information about the bazaar-commits
mailing list