~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Aaron Bentley
  • Date: 2012-03-08 14:54:16 UTC
  • mto: This revision was merged to the branch mainline in revision 6487.
  • Revision ID: aaron@aaronbentley.com-20120308145416-e8g1q57jassv6bb5
Updates from review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
701
701
        finally:
702
702
            copy.unlock()
703
703
        self.assertFalse(self.branch.is_locked())
 
704
        result = self.branch.get_config_stack().get('foo')
704
705
        self.expectFailure('Unlocked branches cache their configs',
705
 
            self.assertEqual, 'bar',
706
 
            self.branch.get_config_stack().get('foo'))
 
706
            self.assertEqual, 'bar', result)
707
707
 
708
708
    def test_set_from_config_get_from_config_stack(self):
709
709
        self.branch.lock_write()
710
710
        self.addCleanup(self.branch.unlock)
711
711
        self.branch.get_config().set_user_option('foo', 'bar')
 
712
        result = self.branch.get_config_stack().get('foo')
712
713
        self.expectFailure('BranchStack uses cache after set_user_option',
713
 
                           self.assertEqual, 'bar',
714
 
                           self.branch.get_config_stack().get('foo'))
 
714
                           self.assertEqual, 'bar', result)
715
715
 
716
716
    def test_set_from_config_stack_get_from_config(self):
717
717
        self.branch.lock_write()
725
725
        self.addCleanup(self.branch.unlock)
726
726
        self.branch.get_config_stack().set('foo', 'bar')
727
727
        copy = _mod_branch.Branch.open(self.branch.base)
 
728
        result = copy.get_config_stack().get('foo')
728
729
        self.expectFailure("Config writes are not cached.", self.assertIs,
729
 
                           None, copy.get_config_stack().get('foo'))
 
730
                           None, result)
730
731
 
731
732
 
732
733
class TestPullResult(tests.TestCase):