~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-17 19:09:45 UTC
  • mfrom: (1770.2.4 config)
  • Revision ID: pqm@pqm.ubuntu.com-20060617190945-49d8ba41828060f5
Rename branches.conf to locations.conf

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
            self.assertEqual(config.branches_config_filename(),
255
255
                             '/home/bogus/.bazaar/branches.conf')
256
256
 
 
257
    def test_locations_config_filename(self):
 
258
        if sys.platform == 'win32':
 
259
            self.assertEqual(config.locations_config_filename(), 
 
260
                'C:/Documents and Settings/bogus/Application Data/bazaar/2.0/locations.conf')
 
261
        else:
 
262
            self.assertEqual(config.locations_config_filename(),
 
263
                             '/home/bogus/.bazaar/locations.conf')
 
264
 
257
265
class TestIniConfig(TestCase):
258
266
 
259
267
    def test_contructs(self):
422
430
        # replace the class that is constructured, to check its parameters
423
431
        oldparserclass = config.ConfigObj
424
432
        config.ConfigObj = InstrumentedConfigObj
425
 
        my_config = config.LocationConfig('http://www.example.com')
426
433
        try:
 
434
            my_config = config.LocationConfig('http://www.example.com')
427
435
            parser = my_config._get_parser()
428
436
        finally:
429
437
            config.ConfigObj = oldparserclass
430
438
        self.failUnless(isinstance(parser, InstrumentedConfigObj))
431
439
        self.assertEqual(parser._calls,
432
 
                         [('__init__', config.branches_config_filename(),
 
440
                         [('__init__', config.locations_config_filename(),
433
441
                           'utf-8')])
 
442
        os.mkdir(config.config_dir())
 
443
        f = file(config.branches_config_filename(), 'wb')
 
444
        f.write('')
 
445
        f.close()
 
446
        oldparserclass = config.ConfigObj
 
447
        config.ConfigObj = InstrumentedConfigObj
 
448
        try:
 
449
            my_config = config.LocationConfig('http://www.example.com')
 
450
            parser = my_config._get_parser()
 
451
        finally:
 
452
            config.ConfigObj = oldparserclass
434
453
 
435
454
    def test_get_global_config(self):
436
455
        my_config = config.LocationConfig('http://example.com')