~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2016-02-01 18:09:18 UTC
  • mfrom: (6614.1.3 assert)
  • mto: This revision was merged to the branch mainline in revision 6615.
  • Revision ID: v.ladeuil+lp@free.fr-20160201180918-jqtq8ol6gdbbbtpv
Fix deprecated assertions to unblock release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2012 Canonical Ltd
 
1
# Copyright (C) 2007-2012, 2016 Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
205
205
        tree.add('file-2')
206
206
        revid2 = tree.commit('rev2')
207
207
        self.run_bzr(['switch', '-b', 'anotherbranch'])
208
 
        self.assertEquals(
 
208
        self.assertEqual(
209
209
            set(['', 'anotherbranch']),
210
210
            set(tree.branch.bzrdir.get_branches().keys()))
211
211
 
238
238
        otherbranch.generate_revision_history(revid1)
239
239
        self.run_bzr(['switch', 'anotherbranch'], working_dir='branch-1')
240
240
        tree = WorkingTree.open("branch-1")
241
 
        self.assertEquals(tree.last_revision(), revid1)
242
 
        self.assertEquals(tree.branch.control_url, otherbranch.control_url)
 
241
        self.assertEqual(tree.last_revision(), revid1)
 
242
        self.assertEqual(tree.branch.control_url, otherbranch.control_url)
243
243
 
244
244
    def test_switch_new_colocated(self):
245
245
        # Create a branch branch-1 that initially is a checkout of 'foo'
253
253
        revid1 = tree.commit('rev1')
254
254
        self.run_bzr(['switch', '-b', 'anotherbranch'], working_dir='branch-1')
255
255
        bzrdir = ControlDir.open("branch-1")
256
 
        self.assertEquals(
 
256
        self.assertEqual(
257
257
            set([b.name for b in bzrdir.list_branches()]),
258
258
            set(["foo", "anotherbranch"]))
259
 
        self.assertEquals(bzrdir.open_branch().name, "anotherbranch")
260
 
        self.assertEquals(bzrdir.open_branch().last_revision(), revid1)
 
259
        self.assertEqual(bzrdir.open_branch().name, "anotherbranch")
 
260
        self.assertEqual(bzrdir.open_branch().last_revision(), revid1)
261
261
 
262
262
    def test_switch_new_colocated_unicode(self):
263
263
        # Create a branch branch-1 that initially is a checkout of 'foo'
272
272
        revid1 = tree.commit('rev1')
273
273
        self.run_bzr(['switch', '-b', u'branch\xe9'], working_dir='branch-1')
274
274
        bzrdir = ControlDir.open("branch-1")
275
 
        self.assertEquals(
 
275
        self.assertEqual(
276
276
            set([b.name for b in bzrdir.list_branches()]),
277
277
            set(["foo", u"branch\xe9"]))
278
 
        self.assertEquals(bzrdir.open_branch().name, u"branch\xe9")
279
 
        self.assertEquals(bzrdir.open_branch().last_revision(), revid1)
 
278
        self.assertEqual(bzrdir.open_branch().name, u"branch\xe9")
 
279
        self.assertEqual(bzrdir.open_branch().last_revision(), revid1)
280
280
 
281
281
    def test_switch_only_revision(self):
282
282
        tree = self._create_sample_tree()