~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_subsume.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-24 13:14:06 UTC
  • mto: (6445.4.5 nested-trees-spec)
  • mto: This revision was merged to the branch mainline in revision 6518.
  • Revision ID: jelmer@samba.org-20120124131406-wedftkorbpv37bm0
Import nested tree doc from devnotes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006-2009, 2011 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
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from bzrlib import bzrdir, errors, repository, workingtree, tests
 
17
from bzrlib import errors, workingtree, tests
18
18
 
19
19
 
20
20
class TestWorkingTree(tests.TestCaseWithTransport):
64
64
        # this test checks the subdir is removed, so it needs to know the
65
65
        # control directory; that changes rarely so just hardcode (and check)
66
66
        # it is correct.
67
 
        self.failUnlessExists('tree/subtree/.bzr')
 
67
        self.assertPathExists('tree/subtree/.bzr')
68
68
        base_tree.subsume(sub_tree)
69
69
        self.assertEqual(['tree-1', 'subtree-1'], base_tree.get_parent_ids())
70
70
        self.assertEqual(sub_root_id, base_tree.path2id('subtree'))
71
71
        self.assertEqual('file2-id', base_tree.path2id('subtree/file2'))
72
72
        # subsuming the tree removes the control directory, so you can't open
73
73
        # it.
74
 
        self.failIfExists('tree/subtree/.bzr')
 
74
        self.assertPathDoesNotExist('tree/subtree/.bzr')
75
75
        file2 = open('tree/subtree/file2', 'rb')
76
76
        try:
77
77
            file2_contents = file2.read()
91
91
        self.assertEqualDiff(file2_contents,
92
92
                             basis_tree.get_file_text('file2-id'))
93
93
        self.assertEqual('subtree-1',
94
 
                         basis_tree.inventory['file2-id'].revision)
 
94
                         basis_tree.get_file_revision('file2-id'))
95
95
        self.assertEqual('combined-1',
96
 
                         basis_tree.inventory[sub_root_id].revision)
 
96
                         basis_tree.get_file_revision(sub_root_id))
97
97
 
98
98
    def test_subsume_failure(self):
99
99
        base_tree, sub_tree = self.make_trees()