~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_branch.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-28 10:06:39 UTC
  • mfrom: (6437.40.2 rmbranch-colo)
  • mto: This revision was merged to the branch mainline in revision 6482.
  • Revision ID: jelmer@samba.org-20120228100639-p5gndu91wuqwugti
Merge rmbranch-colo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2012 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
22
22
    config,
23
23
    delta as _mod_delta,
24
24
    errors,
25
 
    gpg,
26
25
    merge,
27
26
    osutils,
28
27
    urlutils,
529
528
            looked_up_format = registry.get(network_name)
530
529
            self.assertEqual(format.__class__, looked_up_format.__class__)
531
530
 
532
 
    def get_get_config_calls(self):
 
531
    def test_get_config_calls(self):
533
532
        # Smoke test that all branch succeed getting a config
534
533
        br = self.make_branch('.')
535
534
        br.get_config()
780
779
        branch.unbind()
781
780
        self.assertEqual(None, branch.get_master_branch())
782
781
 
783
 
    def test_unlocked_does_not_cache_master_branch(self):
784
 
        """Unlocked branches do not cache the result of get_master_branch."""
785
 
        master = self.make_branch('master')
786
 
        branch1 = self.make_branch('branch')
787
 
        try:
788
 
            branch1.bind(master)
789
 
        except errors.UpgradeRequired:
790
 
            raise tests.TestNotApplicable('Format does not support binding')
791
 
        # Open branch1 again
792
 
        branch2 = branch1.bzrdir.open_branch()
793
 
        self.assertNotEqual(None, branch1.get_master_branch())
794
 
        # Unbind the branch via branch2.  branch1 isn't locked so will
795
 
        # immediately return the new value for get_master_branch.
796
 
        branch2.unbind()
797
 
        self.assertEqual(None, branch1.get_master_branch())
798
 
 
799
782
    def test_bind_clears_cached_master_branch(self):
800
783
        """b.bind clears any cached value of b.get_master_branch."""
801
784
        master1 = self.make_branch('master1')