~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_bound_branches.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-03-12 00:01:34 UTC
  • mfrom: (5582.10.97 weave-plugin)
  • Revision ID: pqm@pqm.ubuntu.com-20110312000134-exy10w8ctjs8tpiu
Tags: upstream-2.4.0~beta1~bzr5718
(jelmer) Add Prober.known_formats() in favour of
 BzrDirFormat.register_format() and ControlDirFormat.register_format().
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Tests of bound branches (binding, unbinding, commit, etc) command."""
19
19
 
20
20
import os
21
 
from cStringIO import StringIO
22
21
 
23
22
from bzrlib import (
24
 
    bzrdir,
25
23
    errors,
26
24
    tests,
27
25
    )
28
26
from bzrlib.branch import Branch
29
 
from bzrlib.bzrdir import (BzrDir, BzrDirFormat, BzrDirMetaFormat1)
30
 
from bzrlib.osutils import getcwd
 
27
from bzrlib.bzrdir import BzrDir
31
28
from bzrlib.tests import script
32
 
import bzrlib.urlutils as urlutils
33
 
from bzrlib.workingtree import WorkingTree
34
 
 
35
 
 
36
 
class TestLegacyFormats(tests.TestCaseWithTransport):
37
 
 
38
 
    def setUp(self):
39
 
        super(TestLegacyFormats, self).setUp()
40
 
        self.build_tree(['master/', 'child/'])
41
 
        self.make_branch_and_tree('master')
42
 
        self.make_branch_and_tree('child',
43
 
                        format=bzrdir.format_registry.make_bzrdir('weave'))
44
 
        os.chdir('child')
45
 
 
46
 
    def test_bind_format_6_bzrdir(self):
47
 
        # bind on a format 6 bzrdir should error
48
 
        out,err = self.run_bzr('bind ../master', retcode=3)
49
 
        self.assertEqual('', out)
50
 
        # TODO: jam 20060427 Probably something like this really should
51
 
        #       print out the actual path, rather than the URL
52
 
        cwd = urlutils.local_path_to_url(getcwd())
53
 
        self.assertEqual('bzr: ERROR: To use this feature you must '
54
 
                         'upgrade your branch at %s/.\n' % cwd, err)
55
 
 
56
 
    def test_unbind_format_6_bzrdir(self):
57
 
        # bind on a format 6 bzrdir should error
58
 
        out,err = self.run_bzr('unbind', retcode=3)
59
 
        self.assertEqual('', out)
60
 
        cwd = urlutils.local_path_to_url(getcwd())
61
 
        self.assertEqual('bzr: ERROR: To use this feature you must '
62
 
                         'upgrade your branch at %s/.\n' % cwd, err)
63
29
 
64
30
 
65
31
class TestBoundBranches(tests.TestCaseWithTransport):