~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testconfig.py

  • Committer: Robert Collins
  • Date: 2005-11-04 23:27:47 UTC
  • Revision ID: robertc@robertcollins.net-20051104232747-5872c68d759bc7be
Bugfix the config test suite to not create .bazaar in the dir where it is run.

Show diffs side-by-side

added added

removed removed

Lines of Context:
325
325
        self.assertEqual(None, my_config.post_commit())
326
326
 
327
327
 
328
 
 
329
328
class TestLocationConfig(TestCase):
330
329
 
331
330
    def test_constructs(self):
472
471
        self.assertEqual('bzrlib.selftest.testconfig.post_commit',
473
472
                         self.my_config.post_commit())
474
473
 
 
474
 
 
475
class TestLocationConfig(TestCaseInTempDir):
 
476
 
 
477
    def get_location_config(self, location, global_config=None):
 
478
        if global_config is None:
 
479
            global_file = StringIO(sample_config_text)
 
480
        else:
 
481
            global_file = StringIO(global_config)
 
482
        branches_file = StringIO(sample_branches_text)
 
483
        self.my_config = config.LocationConfig(location)
 
484
        self.my_config._get_parser(branches_file)
 
485
        self.my_config._get_global_config()._get_parser(global_file)
 
486
 
475
487
    def test_set_user_setting_sets_and_saves(self):
476
488
        # TODO RBC 20051029 test hat mkdir ~/.bazaar is called ..
477
489
        self.get_location_config('/a/c')