~lifeless/ubuntu/lucid/bzr/2.1.2-sru

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_switch.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-06-27 15:23:34 UTC
  • mfrom: (1.3.1 upstream) (3.1.78 karmic)
  • Revision ID: james.westby@ubuntu.com-20090627152334-u3smexjpaolh96qd
* New upstream release.
* Bump standards version to 3.8.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for bzrlib.switch."""
18
18
 
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')