~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Alexander Belchenko
  • Date: 2007-03-05 14:34:28 UTC
  • mto: This revision was merged to the branch mainline in revision 2317.
  • Revision ID: bialix@ukr.net-20070305143428-3carp6uibk6yume4
bzr now use Win32 API to determine Application Data location, and don't rely solely on $APPDATA

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(),