~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Lukáš Lalinský
  • Date: 2007-12-17 17:28:25 UTC
  • mfrom: (3120 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3123.
  • Revision ID: lalinsky@gmail.com-20071217172825-tr3pqm1mhvs3gwnn
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
class TestCreateCheckout(TestCaseWithBranch):
27
27
 
28
28
    def test_checkout_format(self):
29
 
        """Make sure the new checkout uses the same branch format."""
 
29
        """Make sure the new checkout uses the desired branch format."""
30
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
39
31
        tree = a_branch.create_checkout('checkout')
40
 
        if self.branch_format in branch._legacy_formats:
41
 
            # Legacy formats create checkouts with the default format.
42
 
            # Only newer formats create identical checkouts.
43
 
            expected_format = branch.BranchFormat.get_default_format()
44
 
        else:
45
 
            expected_format = a_branch._format
 
32
        # All branches can define the format they want checkouts made in.
 
33
        # This checks it is honoured.
 
34
        expected_format = a_branch._get_checkout_format().get_branch_format()
46
35
        self.assertEqual(expected_format.__class__,
47
36
                         tree.branch._format.__class__)
48
37
 
71
60
    def test_create_checkout_exists(self):
72
61
        """We shouldn't fail if the directory already exists."""
73
62
        tree1 = self.make_branch_and_tree('base')
74
 
        self.build_tree('checkout')
 
63
        self.build_tree(['checkout/'])
75
64
        tree2 = tree1.branch.create_checkout('checkout', lightweight=True)