~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_create_checkout.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib import (
20
20
    branch,
21
21
    )
 
22
from bzrlib.remote import RemoteBranch
22
23
from bzrlib.tests.branch_implementations.test_branch import TestCaseWithBranch
23
24
 
24
25
 
27
28
    def test_checkout_format(self):
28
29
        """Make sure the new checkout uses the same branch format."""
29
30
        a_branch = self.make_branch('branch')
 
31
        if isinstance(a_branch, RemoteBranch):
 
32
            # RemoteBranch formats are not the same as local ones, and dont
 
33
            # duplicate the format string (because there is no format string as
 
34
            # such - it might be e.g. totally virtual on the server end).
 
35
            # This test can only assess the checkout format correctness *in
 
36
            # general* when there is a real object locally present for both the
 
37
            # source and target.
 
38
            return
30
39
        tree = a_branch.create_checkout('checkout')
31
40
        if self.branch_format in branch._legacy_formats:
32
41
            # Legacy formats create checkouts with the default format.
34
43
            expected_format = branch.BranchFormat.get_default_format()
35
44
        else:
36
45
            expected_format = a_branch._format
37
 
        self.assertEqual(expected_format.get_format_string(),
38
 
                         tree.branch._format.get_format_string())
 
46
        self.assertEqual(expected_format.__class__,
 
47
                         tree.branch._format.__class__)
39
48
 
40
49
    def test_create_revision_checkout(self):
41
50
        """Test that we can create a checkout from an earlier revision."""