~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_controldir_colo/test_unsupported.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010 Canonical Ltd
 
1
# Copyright (C) 2010, 2011, 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
40
40
            raise tests.TestNotApplicable('Control dir format not supported')
41
41
        t = self.get_transport()
42
42
        try:
43
 
            made_control = self.bzrdir_format.initialize(t.base)
 
43
            made_control = self.make_bzrdir('.', format=self.bzrdir_format)
44
44
        except errors.UninitializableFormat:
45
45
            raise tests.TestNotApplicable('Control dir format not initializable')
 
46
        self.assertEqual(made_control._format, self.bzrdir_format)
46
47
        made_repo = made_control.create_repository()
47
48
        return made_control
48
49
 
68
69
        made_control = self.make_bzrdir_with_repo()
69
70
        self.assertRaises(errors.NoColocatedBranchSupport,
70
71
            made_control.get_branch_reference, "colo")
 
72
 
 
73
    def test_set_branch_reference(self):
 
74
        referenced = self.make_branch('referenced')
 
75
        made_control = self.make_bzrdir_with_repo()
 
76
        self.assertRaises(errors.NoColocatedBranchSupport,
 
77
            made_control.set_branch_reference, referenced, name="colo")
 
78
 
 
79
    def test_get_branches(self):
 
80
        made_control = self.make_bzrdir_with_repo()
 
81
        made_control.create_branch()
 
82
        self.assertEqual(made_control.get_branches().keys(),
 
83
                         [""])