~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
23
23
from bzrlib import (
24
24
    errors,
25
25
    tests,
26
 
    transport,
27
26
    )
28
27
from bzrlib.tests import (
29
28
    per_controldir,
40
39
            # they may not be initializable.
41
40
            raise tests.TestNotApplicable('Control dir format not supported')
42
41
        t = self.get_transport()
43
 
        made_control = self.bzrdir_format.initialize(t.base)
 
42
        try:
 
43
            made_control = self.make_bzrdir('.', format=self.bzrdir_format)
 
44
        except errors.UninitializableFormat:
 
45
            raise tests.TestNotApplicable('Control dir format not initializable')
 
46
        self.assertEqual(made_control._format, self.bzrdir_format)
44
47
        made_repo = made_control.create_repository()
45
48
        return made_control
46
49
 
66
69
        made_control = self.make_bzrdir_with_repo()
67
70
        self.assertRaises(errors.NoColocatedBranchSupport,
68
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
                         [""])