~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_controldir/test_controldir.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2012, 2016 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
1035
1035
        # network name to use - it's possible that this may somehow have got
1036
1036
        # in through an unisolated test though - see
1037
1037
        # <https://bugs.launchpad.net/bzr/+bug/504102>
1038
 
        self.assertEquals(getattr(self.bzrdir_format,
 
1038
        self.assertEqual(getattr(self.bzrdir_format,
1039
1039
            '_network_name', None),
1040
1040
            None)
1041
1041
        # supported formats must be able to init and open
1214
1214
            raise TestNotApplicable("format does not support "
1215
1215
                "append_revisions_only setting")
1216
1216
        self.assertIsInstance(made_branch, bzrlib.branch.Branch)
1217
 
        self.assertEquals(True, made_branch.get_append_revisions_only())
 
1217
        self.assertEqual(True, made_branch.get_append_revisions_only())
1218
1218
        self.assertEqual(made_control, made_branch.bzrdir)
1219
1219
 
1220
1220
    def test_open_branch(self):
1240
1240
        made_repo = made_control.create_repository()
1241
1241
        made_branch = made_control.create_branch()
1242
1242
        branches = made_control.list_branches()
1243
 
        self.assertEquals(1, len(branches))
1244
 
        self.assertEquals(made_branch.base, branches[0].base)
 
1243
        self.assertEqual(1, len(branches))
 
1244
        self.assertEqual(made_branch.base, branches[0].base)
1245
1245
        try:
1246
1246
            made_control.destroy_branch()
1247
1247
        except errors.UnsupportedOperation:
1248
1248
            pass # Not all bzrdirs support destroying directories
1249
1249
        else:
1250
 
            self.assertEquals([], made_control.list_branches())
 
1250
            self.assertEqual([], made_control.list_branches())
1251
1251
 
1252
1252
    def test_get_branches(self):
1253
1253
        repo = self.make_repository('branch-1')
1384
1384
            raise TestSkipped("Can't initialize %r on transport %r"
1385
1385
                              % (self.bzrdir_format, t))
1386
1386
        dir = controldir.ControlDir.open(t.base+",branch=foo")
1387
 
        self.assertEquals({"branch": "foo"},
 
1387
        self.assertEqual({"branch": "foo"},
1388
1388
            dir.user_transport.get_segment_parameters())
1389
 
        self.assertEquals("foo", dir._get_selected_branch())
 
1389
        self.assertEqual("foo", dir._get_selected_branch())
1390
1390
 
1391
1391
    def test_get_selected_branch_none_selected(self):
1392
1392
        # _get_selected_branch defaults to None
1563
1563
             ((dir_relpath2, _), entries2)) in izip(
1564
1564
                osutils.walkdirs(old_path),
1565
1565
                osutils.walkdirs(new_path)):
1566
 
            self.assertEquals(dir_relpath1, dir_relpath2)
 
1566
            self.assertEqual(dir_relpath1, dir_relpath2)
1567
1567
            for f1, f2 in zip(entries1, entries2):
1568
 
                self.assertEquals(f1[0], f2[0])
1569
 
                self.assertEquals(f1[2], f2[2])
 
1568
                self.assertEqual(f1[0], f2[0])
 
1569
                self.assertEqual(f1[2], f2[2])
1570
1570
                if f1[2] == "file":
1571
1571
                    osutils.compare_files(open(f1[4]), open(f2[4]))
1572
1572