19
19
For interface contract tests, see tests/per_bzr_dir.
24
25
from bzrlib import (
31
34
from bzrlib.osutils import (
38
from bzrlib.tests.test_bundle import V4BundleTester
34
39
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
35
40
from bzrlib.tests import (
36
41
TestCaseWithTransport,
39
from bzrlib.bzrdir_weave import (
44
from bzrlib.plugins.weave_fmt.branch import (
47
from bzrlib.plugins.weave_fmt.bzrdir import (
521
class TestBranchFormat4(TestCaseWithTransport):
522
"""Tests specific to branch format 4"""
524
def test_no_metadir_support(self):
526
bdir = bzrdir.BzrDirMetaFormat1().initialize(url)
527
bdir.create_repository()
528
self.assertRaises(errors.IncompatibleFormat,
529
BzrBranchFormat4().initialize, bdir)
531
def test_supports_bzrdir_6(self):
533
bdir = BzrDirFormat6().initialize(url)
534
bdir.create_repository()
535
BzrBranchFormat4().initialize(bdir)
538
class TestBoundBranch(TestCaseWithTransport):
541
super(TestBoundBranch, self).setUp()
542
self.build_tree(['master/', 'child/'])
543
self.make_branch_and_tree('master')
544
self.make_branch_and_tree('child',
545
format=bzrdir.format_registry.make_bzrdir('weave'))
548
def test_bind_format_6_bzrdir(self):
549
# bind on a format 6 bzrdir should error
550
out,err = self.run_bzr('bind ../master', retcode=3)
551
self.assertEqual('', out)
552
# TODO: jam 20060427 Probably something like this really should
553
# print out the actual path, rather than the URL
554
cwd = urlutils.local_path_to_url(getcwd())
555
self.assertEqual('bzr: ERROR: To use this feature you must '
556
'upgrade your branch at %s/.\n' % cwd, err)
558
def test_unbind_format_6_bzrdir(self):
559
# bind on a format 6 bzrdir should error
560
out,err = self.run_bzr('unbind', retcode=3)
561
self.assertEqual('', out)
562
cwd = urlutils.local_path_to_url(getcwd())
563
self.assertEqual('bzr: ERROR: To use this feature you must '
564
'upgrade your branch at %s/.\n' % cwd, err)
567
class TestInit(TestCaseWithTransport):
569
def test_init_weave(self):
570
# --format=weave should be accepted to allow interoperation with
571
# old releases when desired.
572
out, err = self.run_bzr('init --format=weave')
573
self.assertEqual("""Created a standalone tree (format: weave)\n""",
575
self.assertEqual('', err)
578
class V4WeaveBundleTester(V4BundleTester):
580
def bzrdir_format(self):