~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
269
269
 
270
270
    def setUp(self):
271
271
        super(TestConfigPath, self).setUp()
272
 
        self.old_home = os.environ.get('HOME', None)
273
 
        self.old_appdata = os.environ.get('APPDATA', None)
274
272
        os.environ['HOME'] = '/home/bogus'
275
 
        os.environ['APPDATA'] = \
276
 
            r'C:\Documents and Settings\bogus\Application Data'
 
273
        if sys.platform == 'win32':
 
274
            os.environ['BZR_HOME'] = \
 
275
                r'C:\Documents and Settings\bogus\Application Data'
277
276
 
278
 
    def tearDown(self):
279
 
        if self.old_home is None:
280
 
            del os.environ['HOME']
281
 
        else:
282
 
            os.environ['HOME'] = self.old_home
283
 
        if self.old_appdata is None:
284
 
            del os.environ['APPDATA']
285
 
        else:
286
 
            os.environ['APPDATA'] = self.old_appdata
287
 
        super(TestConfigPath, self).tearDown()
288
 
    
289
277
    def test_config_dir(self):
290
278
        if sys.platform == 'win32':
291
279
            self.assertEqual(config.config_dir(), 
413
401
 
414
402
    def test_config_creates_local(self):
415
403
        """Creating a new entry in config uses a local path."""
416
 
        branch = self.make_branch('branch')
 
404
        branch = self.make_branch('branch', format='knit')
417
405
        branch.set_push_location('http://foobar')
418
406
        locations = config.locations_config_filename()
419
407
        local_path = osutils.getcwd().encode('utf8')