~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

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):
371
337
 
372
338
        child_tree.merge_from_branch(other_branch)
373
339
 
374
 
        self.failUnlessExists('child/c')
 
340
        self.assertPathExists('child/c')
375
341
        self.assertEqual([new_rev_id], child_tree.get_parent_ids()[1:])
376
342
 
377
343
        # Make sure the local branch has the installed revision
443
409
    def test_bind_when_bound(self):
444
410
        self.run_script("""
445
411
$ bzr init trunk
 
412
...
446
413
$ bzr init copy
 
414
...
447
415
$ cd copy
448
416
$ bzr bind ../trunk
449
417
$ bzr bind
453
421
    def test_bind_before_bound(self):
454
422
        self.run_script("""
455
423
$ bzr init trunk
 
424
...
456
425
$ cd trunk
457
426
$ bzr bind
458
427
2>bzr: ERROR: No location supplied and no previous location known