/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    script,
26
26
    test_config as _t_config,
27
27
    )
 
28
from ..matchers import ContainsNoVfsCalls
28
29
 
29
30
 
30
31
class TestWithoutConfig(tests.TestCaseWithTransport):
35
36
        self.assertEqual('', err)
36
37
 
37
38
    def test_remove_unknown_option(self):
38
 
        self.run_bzr_error(['The "file" configuration option does not exist', ],
 
39
        self.run_bzr_error(['The "file" configuration option does not exist',],
39
40
                           ['config', '--remove', 'file'])
40
41
 
41
42
    def test_all_remove_exclusive(self):
42
 
        self.run_bzr_error(['--all and --remove are mutually exclusive.', ],
 
43
        self.run_bzr_error(['--all and --remove are mutually exclusive.',],
43
44
                           ['config', '--remove', '--all'])
44
45
 
45
46
    def test_all_set_exclusive(self):
46
 
        self.run_bzr_error(['Only one option can be set.', ],
 
47
        self.run_bzr_error(['Only one option can be set.',],
47
48
                           ['config', '--all', 'hello=world'])
48
49
 
49
50
    def test_remove_no_option(self):
50
 
        self.run_bzr_error(['--remove expects an option to remove.', ],
 
51
        self.run_bzr_error(['--remove expects an option to remove.',],
51
52
                           ['config', '--remove'])
52
53
 
53
54
    def test_unknown_option(self):
54
 
        self.run_bzr_error(['The "file" configuration option does not exist', ],
 
55
        self.run_bzr_error(['The "file" configuration option does not exist',],
55
56
                           ['config', 'file'])
56
57
 
57
58
    def test_unexpected_regexp(self):
58
59
        self.run_bzr_error(
59
 
            ['The "\\*file" configuration option does not exist', ],
 
60
            ['The "\*file" configuration option does not exist',],
60
61
            ['config', '*file'])
61
62
 
62
63
    def test_wrong_regexp(self):
63
64
        self.run_bzr_error(
64
 
            ['Invalid pattern\\(s\\) found. "\\*file" nothing to repeat', ],
 
65
            ['Invalid pattern\(s\) found. "\*file" nothing to repeat',],
65
66
            ['config', '--all', '*file'])
66
67
 
67
68
 
 
69
 
68
70
class TestConfigDisplay(tests.TestCaseWithTransport):
69
71
 
70
72
    def setUp(self):
114
116
            ''')
115
117
 
116
118
    def test_registry_value_all(self):
117
 
        self.breezy_config.set_user_option('transform.orphan_policy',
 
119
        self.breezy_config.set_user_option('bzr.transform.orphan_policy',
118
120
                                           u'move')
119
121
        script.run_script(self, '''\
120
122
            $ brz config -d tree
121
123
            breezy:
122
124
              [DEFAULT]
123
 
              transform.orphan_policy = move
 
125
              bzr.transform.orphan_policy = move
124
126
            ''')
125
127
 
126
128
    def test_registry_value_one(self):
127
 
        self.breezy_config.set_user_option('transform.orphan_policy',
 
129
        self.breezy_config.set_user_option('bzr.transform.orphan_policy',
128
130
                                           u'move')
129
131
        script.run_script(self, '''\
130
 
            $ brz config -d tree transform.orphan_policy
 
132
            $ brz config -d tree bzr.transform.orphan_policy
131
133
            move
132
134
            ''')
133
135
 
365
367
            ''')
366
368
 
367
369
 
 
370
class TestSmartServerConfig(tests.TestCaseWithTransport):
 
371
 
 
372
    def test_simple_branch_config(self):
 
373
        self.setup_smart_server_with_call_log()
 
374
        t = self.make_branch_and_tree('branch')
 
375
        self.reset_smart_call_log()
 
376
        out, err = self.run_bzr(['config', '-d', self.get_url('branch')])
 
377
        # This figure represent the amount of work to perform this use case. It
 
378
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
379
        # being too low. If rpc_count increases, more network roundtrips have
 
380
        # become necessary for this use case. Please do not adjust this number
 
381
        # upwards without agreement from bzr's network support maintainers.
 
382
        self.assertLength(5, self.hpss_calls)
 
383
        self.assertLength(1, self.hpss_connections)
 
384
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
385
 
 
386
 
368
387
class TestConfigDirectory(tests.TestCaseWithTransport):
369
388
 
370
389
    def test_parent_alias(self):