/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
6614.1.3 by Vincent Ladeuil
Fix assertEquals being deprecated by using assertEqual.
1
# Copyright (C) 2010, 2011, 2012, 2016 Canonical Ltd
5227.1.3 by Andrew Bennetts
Add missing test file.
2
#
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17
"""Tests for branch.get_config behaviour."""
18
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
19
from breezy import (
5227.1.3 by Andrew Bennetts
Add missing test file.
20
    branch,
21
    errors,
6670.4.14 by Jelmer Vernooij
Move remote to breezy.bzr.
22
    tests,
23
    )
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
24
from breezy.tests import per_branch
5227.1.3 by Andrew Bennetts
Add missing test file.
25
26
27
class TestGetConfig(per_branch.TestCaseWithBranch):
28
29
    def test_set_user_option_with_dict(self):
30
        b = self.make_branch('b')
31
        config = b.get_config()
32
        value_dict = {
33
            'ascii': 'abcd', u'unicode \N{WATCH}': u'foo \N{INTERROBANG}'}
34
        config.set_user_option('name', value_dict.copy())
5549.1.26 by Vincent Ladeuil
At IRC request, rename interpolation to option expansion.
35
        self.assertEqual(value_dict, config.get_user_option('name'))
5227.1.3 by Andrew Bennetts
Add missing test file.
36
6531.2.1 by Vincent Ladeuil
Add a failing test and a brain-dead fix (duplicating the existing code).
37
    def test_set_submit_branch(self):
38
        # Make sure setting a config option persists on disk
39
        b = self.make_branch('.')
40
        b.set_submit_branch('foo')
41
        # Refresh the branch
42
        b = branch.Branch.open('.')
6614.1.3 by Vincent Ladeuil
Fix assertEquals being deprecated by using assertEqual.
43
        self.assertEqual('foo', b.get_submit_branch())