~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-01-05 10:44:12 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6427.
  • Revision ID: martin.packman@canonical.com-20120105104412-z03fi9m43h946fvs
Merge bzr.dev to resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        script.run_script(self, '''\
80
80
            $ bzr config -d tree
81
81
            bazaar:
 
82
              [DEFAULT]
82
83
              multiline = """1
83
84
            2
84
85
            """
95
96
            ''')
96
97
 
97
98
    def test_list_all_values(self):
98
 
        # FIXME: we should register the option as a list or it's displayed as
99
 
        # astring and as such, quoted.
 
99
        config.option_registry.register(config.ListOption('list'))
 
100
        self.addCleanup(config.option_registry.remove, 'list')
100
101
        self.bazaar_config.set_user_option('list', [1, 'a', 'with, a comma'])
101
102
        script.run_script(self, '''\
102
103
            $ bzr config -d tree
103
104
            bazaar:
104
 
              list = '1, a, "with, a comma"'
 
105
              [DEFAULT]
 
106
              list = 1, a, "with, a comma"
105
107
            ''')
106
108
 
107
109
    def test_list_value_only(self):
108
 
        # FIXME: we should register the option as a list or it's displayed as
109
 
        # astring and as such, quoted.
 
110
        config.option_registry.register(config.ListOption('list'))
 
111
        self.addCleanup(config.option_registry.remove, 'list')
110
112
        self.bazaar_config.set_user_option('list', [1, 'a', 'with, a comma'])
111
113
        script.run_script(self, '''\
112
114
            $ bzr config -d tree list
113
 
            '1, a, "with, a comma"'
 
115
            1, a, "with, a comma"
114
116
            ''')
115
117
 
116
118
    def test_bazaar_config(self):
118
120
        script.run_script(self, '''\
119
121
            $ bzr config -d tree
120
122
            bazaar:
 
123
              [DEFAULT]
121
124
              hello = world
122
125
            ''')
123
126
 
139
142
        script.run_script(self, '''\
140
143
            $ bzr config
141
144
            bazaar:
142
 
              hello = world
143
 
            ''')
 
145
              [DEFAULT]
 
146
              hello = world
 
147
            ''')
 
148
 
 
149
    def test_cmd_line(self):
 
150
        self.bazaar_config.set_user_option('hello', 'world')
 
151
        script.run_script(self, '''\
 
152
            $ bzr config -Ohello=bzr
 
153
            cmdline:
 
154
              hello = bzr
 
155
            bazaar:
 
156
              [DEFAULT]
 
157
              hello = world
 
158
            ''')
 
159
 
144
160
 
145
161
class TestConfigDisplayWithPolicy(tests.TestCaseWithTransport):
146
162
 
213
229
            $ bzr config --scope bazaar hello=world
214
230
            $ bzr config -d tree --all hello
215
231
            bazaar:
 
232
              [DEFAULT]
216
233
              hello = world
217
234
            ''')
218
235
 
221
238
            $ bzr config -d tree --scope bazaar hello=world
222
239
            $ bzr config -d tree --all hello
223
240
            bazaar:
 
241
              [DEFAULT]
224
242
              hello = world
225
243
            ''')
226
244
 
289
307
            branch:
290
308
              file = branch
291
309
            bazaar:
 
310
              [DEFAULT]
292
311
              file = bazaar
293
312
            ''')
294
313
 
299
318
            branch:
300
319
              file = branch
301
320
            bazaar:
 
321
              [DEFAULT]
302
322
              file = bazaar
303
323
            ''')
304
324
        script.run_script(self, '''\
305
325
            $ bzr config -d tree --remove file
306
326
            $ bzr config -d tree --all file
307
327
            bazaar:
 
328
              [DEFAULT]
308
329
              file = bazaar
309
330
            ''')
310
331
 
316
337
              [.../work/tree]
317
338
              file = locations
318
339
            bazaar:
 
340
              [DEFAULT]
319
341
              file = bazaar
320
342
            ''')
321
343
        script.run_script(self, '''\
322
344
            $ bzr config -d tree --scope locations --remove file
323
345
            $ bzr config -d tree --all file
324
346
            bazaar:
 
347
              [DEFAULT]
325
348
              file = bazaar
326
349
            ''')
327
350
 
339
362
        # become necessary for this use case. Please do not adjust this number
340
363
        # upwards without agreement from bzr's network support maintainers.
341
364
        self.assertLength(5, self.hpss_calls)
 
365
        self.assertLength(1, self.hpss_connections)
342
366
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)