35
36
self.assertEqual('', err)
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'])
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'])
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'])
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'])
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'])
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'])
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'])
68
70
class TestConfigDisplay(tests.TestCaseWithTransport):
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',
119
121
script.run_script(self, '''\
120
122
$ brz config -d tree
123
transform.orphan_policy = move
125
bzr.transform.orphan_policy = move
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',
129
131
script.run_script(self, '''\
130
$ brz config -d tree transform.orphan_policy
132
$ brz config -d tree bzr.transform.orphan_policy
370
class TestSmartServerConfig(tests.TestCaseWithTransport):
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)
368
387
class TestConfigDirectory(tests.TestCaseWithTransport):
370
389
def test_parent_alias(self):