~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:56:05 UTC
  • mfrom: (6615.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201195605-o7rl92wf6uyum3fk
(vila) Open trunk again as 2.8b1 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for the Branch.create_checkout"""
18
18
 
19
 
from bzrlib import (
20
 
    branch,
21
 
    )
22
19
from bzrlib.tests import per_branch
23
20
 
24
21
 
25
22
class TestCreateCheckout(per_branch.TestCaseWithBranch):
26
23
 
27
 
    def test_checkout_format(self):
28
 
        """Make sure the new checkout uses the desired branch format."""
29
 
        a_branch = self.make_branch('branch')
30
 
        tree = a_branch.create_checkout('checkout')
31
 
        # All branches can define the format they want checkouts made in.
32
 
        # This checks it is honoured.
33
 
        expected_format = a_branch._get_checkout_format().get_branch_format()
34
 
        self.assertEqual(expected_format.__class__,
35
 
                         tree.branch._format.__class__)
 
24
    def test_checkout_format_lightweight(self):
 
25
        """Make sure the new light checkout uses the desired branch format."""
 
26
        a_branch = self.make_branch('branch')
 
27
        tree = a_branch.create_checkout('checkout', lightweight=True)
 
28
        # All branches can define the format they want checkouts made in.
 
29
        # This checks it is honoured.
 
30
        expected_format = a_branch._get_checkout_format(lightweight=True)
 
31
        self.assertEqual(expected_format.get_branch_format().network_name(),
 
32
                         tree.branch._format.network_name())
 
33
 
 
34
    def test_checkout_format_heavyweight(self):
 
35
        """Make sure the new heavy checkout uses the desired branch format."""
 
36
        a_branch = self.make_branch('branch')
 
37
        tree = a_branch.create_checkout('checkout', lightweight=False)
 
38
        # All branches can define the format they want checkouts made in.
 
39
        # This checks it is honoured.
 
40
        expected_format = a_branch._get_checkout_format(lightweight=False)
 
41
        self.assertEqual(expected_format.get_branch_format().network_name(),
 
42
                         tree.branch._format.network_name())
36
43
 
37
44
    def test_create_revision_checkout(self):
38
45
        """Test that we can create a checkout from an earlier revision."""
46
53
 
47
54
        tree2 = tree1.branch.create_checkout('checkout', revision_id='rev-1')
48
55
        self.assertEqual('rev-1', tree2.last_revision())
49
 
        self.failUnlessExists('checkout/a')
50
 
        self.failIfExists('checkout/b')
 
56
        self.assertPathExists('checkout/a')
 
57
        self.assertPathDoesNotExist('checkout/b')
51
58
 
52
59
    def test_create_lightweight_checkout(self):
53
60
        """We should be able to make a lightweight checkout."""