~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-12-24 10:10:59 UTC
  • mfrom: (6405 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6407.
  • Revision ID: jelmer@samba.org-20111224101059-epghsc5y61hsgbl2
Merge bzr.dev.

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:
 
145
              [DEFAULT]
142
146
              hello = world
143
147
            ''')
144
148
 
 
149
 
145
150
class TestConfigDisplayWithPolicy(tests.TestCaseWithTransport):
146
151
 
147
152
    def test_location_with_policy(self):
213
218
            $ bzr config --scope bazaar hello=world
214
219
            $ bzr config -d tree --all hello
215
220
            bazaar:
 
221
              [DEFAULT]
216
222
              hello = world
217
223
            ''')
218
224
 
221
227
            $ bzr config -d tree --scope bazaar hello=world
222
228
            $ bzr config -d tree --all hello
223
229
            bazaar:
 
230
              [DEFAULT]
224
231
              hello = world
225
232
            ''')
226
233
 
289
296
            branch:
290
297
              file = branch
291
298
            bazaar:
 
299
              [DEFAULT]
292
300
              file = bazaar
293
301
            ''')
294
302
 
299
307
            branch:
300
308
              file = branch
301
309
            bazaar:
 
310
              [DEFAULT]
302
311
              file = bazaar
303
312
            ''')
304
313
        script.run_script(self, '''\
305
314
            $ bzr config -d tree --remove file
306
315
            $ bzr config -d tree --all file
307
316
            bazaar:
 
317
              [DEFAULT]
308
318
              file = bazaar
309
319
            ''')
310
320
 
316
326
              [.../work/tree]
317
327
              file = locations
318
328
            bazaar:
 
329
              [DEFAULT]
319
330
              file = bazaar
320
331
            ''')
321
332
        script.run_script(self, '''\
322
333
            $ bzr config -d tree --scope locations --remove file
323
334
            $ bzr config -d tree --all file
324
335
            bazaar:
 
336
              [DEFAULT]
325
337
              file = bazaar
326
338
            ''')
327
339