~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Packman
  • Date: 2012-02-01 13:24:42 UTC
  • mto: (6437.23.4 2.5)
  • mto: This revision was merged to the branch mainline in revision 6462.
  • Revision ID: martin.packman@canonical.com-20120201132442-ela7jc4mxv4b058o
Treat path for .bzr.log as unicode

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010, 2011, 2012, 2016 Canonical Ltd
 
1
# Copyright (C) 2010 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
32
32
 
33
33
    def test_config_all(self):
34
34
        out, err = self.run_bzr(['config'])
35
 
        self.assertEqual('', out)
36
 
        self.assertEqual('', err)
 
35
        self.assertEquals('', out)
 
36
        self.assertEquals('', err)
37
37
 
38
38
    def test_remove_unknown_option(self):
39
39
        self.run_bzr_error(['The "file" configuration option does not exist',],
95
95
            """
96
96
            ''')
97
97
 
98
 
    def test_list_value_all(self):
 
98
    def test_list_all_values(self):
99
99
        config.option_registry.register(config.ListOption('list'))
100
100
        self.addCleanup(config.option_registry.remove, 'list')
101
101
        self.bazaar_config.set_user_option('list', [1, 'a', 'with, a comma'])
106
106
              list = 1, a, "with, a comma"
107
107
            ''')
108
108
 
109
 
    def test_list_value_one(self):
 
109
    def test_list_value_only(self):
110
110
        config.option_registry.register(config.ListOption('list'))
111
111
        self.addCleanup(config.option_registry.remove, 'list')
112
112
        self.bazaar_config.set_user_option('list', [1, 'a', 'with, a comma'])
115
115
            1, a, "with, a comma"
116
116
            ''')
117
117
 
118
 
    def test_registry_value_all(self):
119
 
        self.bazaar_config.set_user_option('bzr.transform.orphan_policy',
120
 
                                           u'move')
121
 
        script.run_script(self, '''\
122
 
            $ bzr config -d tree
123
 
            bazaar:
124
 
              [DEFAULT]
125
 
              bzr.transform.orphan_policy = move
126
 
            ''')
127
 
 
128
 
    def test_registry_value_one(self):
129
 
        self.bazaar_config.set_user_option('bzr.transform.orphan_policy',
130
 
                                           u'move')
131
 
        script.run_script(self, '''\
132
 
            $ bzr config -d tree bzr.transform.orphan_policy
133
 
            move
134
 
            ''')
135
 
 
136
118
    def test_bazaar_config(self):
137
119
        self.bazaar_config.set_user_option('hello', 'world')
138
120
        script.run_script(self, '''\
382
364
        self.assertLength(5, self.hpss_calls)
383
365
        self.assertLength(1, self.hpss_connections)
384
366
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
385
 
 
386
 
 
387
 
class TestConfigDirectory(tests.TestCaseWithTransport):
388
 
 
389
 
    def test_parent_alias(self):
390
 
        t = self.make_branch_and_tree('base')
391
 
        t.branch.get_config_stack().set('test', 'base')
392
 
        clone = t.branch.bzrdir.sprout('clone').open_branch()
393
 
        clone.get_config_stack().set('test', 'clone')
394
 
        out, err = self.run_bzr(['config', '-d', ':parent', 'test'],
395
 
                                working_dir='clone')
396
 
        self.assertEqual('base\n', out)