~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_switch.py

  • Committer: Johan Walles
  • Date: 2009-05-07 05:08:46 UTC
  • mfrom: (4342 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4343.
  • Revision ID: johan.walles@gmail.com-20090507050846-nkwvcyauf1eh653q
MergeĀ fromĀ upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
        os.rename('branch-1', 'branch-2')
71
71
        to_branch = branch.Branch.open('branch-2')
72
72
        # Check fails without --force
73
 
        err = self.assertRaises((errors.NotBranchError,
74
 
            errors.BoundBranchConnectionFailure),
 
73
        err = self.assertRaises(
 
74
            (errors.BzrCommandError, errors.NotBranchError),
75
75
            switch.switch, checkout.bzrdir, to_branch)
 
76
        if isinstance(err, errors.BzrCommandError):
 
77
            self.assertContainsRe(str(err),
 
78
                'Unable to connect to current master branch .*'
 
79
                'To switch anyway, use --force.')
76
80
        switch.switch(checkout.bzrdir, to_branch, force=True)
77
81
        self.failIfExists('checkout/file-1')
78
82
        self.failUnlessExists('checkout/file-2')