~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testconfig.py

  • Committer: Robert Collins
  • Date: 2005-10-20 02:52:44 UTC
  • Revision ID: robertc@robertcollins.net-20051020025244-fa1017d19a0ef618
post commit hook, first pass implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
                        "recurse=False\n"
67
67
                        "[/a/c]\n"
68
68
                        "check_signatures=ignore\n"
 
69
                        "post_commit=bzrlib.selftest.testconfig.post_commit\n"
69
70
                        "#testing explicit beats globs\n")
70
71
 
71
72
 
154
155
        my_config = config.Config()
155
156
        self.assertEqual(None, my_config.get_user_option('no_option'))
156
157
 
 
158
    def test_post_commit_default(self):
 
159
        my_config = config.Config()
 
160
        self.assertEqual(None, my_config.post_commit())
 
161
 
157
162
 
158
163
class TestConfigPath(TestCase):
159
164
 
303
308
        my_config = self._get_sample_config()
304
309
        self.assertEqual("something",
305
310
                         my_config.get_user_option('user_global_option'))
 
311
        
 
312
    def test_post_commit_default(self):
 
313
        my_config = self._get_sample_config()
 
314
        self.assertEqual(None, my_config.post_commit())
 
315
 
306
316
 
307
317
 
308
318
class TestLocationConfig(TestCase):
441
451
        self.get_location_config('/a')
442
452
        self.assertEqual('local',
443
453
                         self.my_config.get_user_option('user_local_option'))
 
454
        
 
455
    def test_post_commit_default(self):
 
456
        self.get_location_config('/a/c')
 
457
        self.assertEqual('bzrlib.selftest.testconfig.post_commit',
 
458
                         self.my_config.post_commit())
444
459
 
445
460
 
446
461
class TestBranchConfigItems(TestCase):
496
511
            _get_global_config()._get_parser(config_file))
497
512
        self.assertEqual('something',
498
513
                         my_config.get_user_option('user_global_option'))
 
514
 
 
515
    def test_post_commit_default(self):
 
516
        branch = FakeBranch()
 
517
        branch.base='/a/c'
 
518
        my_config = config.BranchConfig(branch)
 
519
        config_file = StringIO(sample_config_text)
 
520
        (my_config._get_location_config().
 
521
            _get_global_config()._get_parser(config_file))
 
522
        branch_file = StringIO(sample_branches_text)
 
523
        my_config._get_location_config()._get_parser(branch_file)
 
524
        self.assertEqual('bzrlib.selftest.testconfig.post_commit',
 
525
                         my_config.post_commit())