~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
22
22
 
23
23
from bzrlib import (
24
24
    bzrdir,
25
 
    errors
 
25
    errors,
 
26
    tests,
26
27
    )
27
28
from bzrlib.branch import Branch
28
29
from bzrlib.bzrdir import (BzrDir, BzrDirFormat, BzrDirMetaFormat1)
29
30
from bzrlib.osutils import getcwd
30
 
from bzrlib.tests import TestCaseWithTransport
 
31
from bzrlib.tests import script
31
32
import bzrlib.urlutils as urlutils
32
33
from bzrlib.workingtree import WorkingTree
33
34
 
34
35
 
35
 
class TestLegacyFormats(TestCaseWithTransport):
 
36
class TestLegacyFormats(tests.TestCaseWithTransport):
36
37
 
37
38
    def setUp(self):
38
39
        super(TestLegacyFormats, self).setUp()
61
62
                         'upgrade your branch at %s/.\n' % cwd, err)
62
63
 
63
64
 
64
 
class TestBoundBranches(TestCaseWithTransport):
 
65
class TestBoundBranches(tests.TestCaseWithTransport):
65
66
 
66
67
    def create_branches(self):
67
68
        base_tree = self.make_branch_and_tree('base')
420
421
        # both the local and master should have been updated.
421
422
        self.check_revno(4)
422
423
        self.check_revno(4, '../base')
 
424
 
 
425
 
 
426
class TestBind(script.TestCaseWithTransportAndScript):
 
427
 
 
428
    def test_bind_when_bound(self):
 
429
        self.run_script("""
 
430
$ bzr init trunk
 
431
$ bzr init copy
 
432
$ cd copy
 
433
$ bzr bind ../trunk
 
434
$ bzr bind
 
435
2>bzr: ERROR: Branch is already bound
 
436
""")
 
437
 
 
438
    def test_bind_before_bound(self):
 
439
        self.run_script("""
 
440
$ bzr init trunk
 
441
$ cd trunk
 
442
$ bzr bind
 
443
2>bzr: ERROR: No location supplied and no previous location known
 
444
""")