/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/per_tree/test_inv.py

  • Committer: Jelmer Vernooij
  • Date: 2018-03-24 17:48:04 UTC
  • mfrom: (6921 work)
  • mto: This revision was merged to the branch mainline in revision 6923.
  • Revision ID: jelmer@jelmer.uk-20180324174804-xf22o05byoj12x1q
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    )
34
34
 
35
35
 
36
 
def get_entry(tree, file_id):
37
 
    return tree.iter_entries_by_dir([file_id]).next()[1]
 
36
def get_entry(tree, path):
 
37
    return tree.iter_entries_by_dir(specific_files=[path]).next()[1]
38
38
 
39
39
 
40
40
class TestInventoryWithSymlinks(per_tree.TestCaseWithTree):
52
52
            raise TestSkipped(
53
53
                'symlinks not accurately represented in working trees and'
54
54
                ' preview trees')
55
 
        entry = get_entry(self.tree, self.tree.path2id('symlink'))
 
55
        entry = get_entry(self.tree, 'symlink')
56
56
        self.assertEqual(entry.symlink_target, 'link-target')
57
57
 
58
58
    def test_symlink_target_tree(self):
64
64
        self.assertIs(None, self.tree.get_file_size('symlink'))
65
65
 
66
66
    def test_symlink(self):
67
 
        entry = get_entry(self.tree, self.tree.path2id('symlink'))
 
67
        entry = get_entry(self.tree, 'symlink')
68
68
        self.assertEqual(entry.kind, 'symlink')
69
69
        self.assertEqual(None, entry.text_size)
70
70
 
76
76
        self.build_tree(['tree/dir/', 'tree/dir/file'])
77
77
        work_tree.add(['dir', 'dir/file'])
78
78
        tree = self._convert_tree(work_tree)
 
79
        if not isinstance(tree, InventoryTree):
 
80
            raise tests.TestNotApplicable(
 
81
                "test not applicable on non-inventory tests")
79
82
        tree.lock_read()
80
83
        self.addCleanup(tree.unlock)
81
84
        self.assertEqual({tree.path2id('dir'), tree.path2id('dir/file')},
88
91
        work_tree.commit('commit old state')
89
92
        work_tree.remove('file')
90
93
        tree = self._convert_tree(work_tree)
 
94
        if not isinstance(tree, InventoryTree):
 
95
            raise tests.TestNotApplicable(
 
96
                "test not applicable on non-inventory tests")
91
97
        tree.lock_read()
92
98
        self.addCleanup(tree.unlock)
93
99
        self.assertEqual(set([]), tree.paths2ids(['file'],