~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/tree_implementations/test_inv.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-04 15:29:17 UTC
  • mfrom: (2961 +trunk)
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071104152917-nrsumxpk3dikso2c
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from bzrlib.diff import internal_diff
24
24
from bzrlib.mutabletree import MutableTree
25
 
from bzrlib.osutils import (
26
 
    has_symlinks,
27
 
    )
 
25
from bzrlib.osutils import has_symlinks
28
26
from bzrlib.symbol_versioning import zero_ninetyone
29
 
from bzrlib.tests import TestSkipped
 
27
from bzrlib.tests import SymlinkFeature, TestSkipped
30
28
from bzrlib.tests.tree_implementations import TestCaseWithTree
31
29
from bzrlib.uncommit import uncommit
32
30
 
109
107
                          output)
110
108
        self.assertEqual(output.getvalue(), 
111
109
                         "Binary files /dev/null and new_label differ\n")
 
110
 
112
111
    def test_link_diff_deleted(self):
113
 
        if not has_symlinks():
114
 
            return
 
112
        self.requireFeature(SymlinkFeature)
115
113
        output = StringIO()
116
114
        self.link_1.diff(internal_diff, 
117
115
                          "old_label", self.tree_1,
121
119
                         "=== target was 'target1'\n")
122
120
 
123
121
    def test_link_diff_added(self):
124
 
        if not has_symlinks():
125
 
            return
 
122
        self.requireFeature(SymlinkFeature)
126
123
        output = StringIO()
127
124
        self.link_1.diff(internal_diff, 
128
125
                          "new_label", self.tree_1,
132
129
                         "=== target is 'target1'\n")
133
130
 
134
131
    def test_link_diff_changed(self):
135
 
        if not has_symlinks():
136
 
            return
 
132
        self.requireFeature(SymlinkFeature)
137
133
        output = StringIO()
138
134
        self.link_1.diff(internal_diff, 
139
135
                          "/dev/null", self.tree_1, 
222
218
        self.inv = self.tree.inventory
223
219
 
224
220
    def test_symlink_target(self):
225
 
        if not has_symlinks():
226
 
            raise TestSkipped('No symlink support')
 
221
        self.requireFeature(SymlinkFeature)
227
222
        self._set_up()
228
223
        if isinstance(self.tree, MutableTree):
229
224
            raise TestSkipped(
232
227
        self.assertEqual(entry.symlink_target, 'link-target')
233
228
 
234
229
    def test_symlink(self):
235
 
        if not has_symlinks():
236
 
            raise TestSkipped('No symlink support')
 
230
        self.requireFeature(SymlinkFeature)
237
231
        self._set_up()
238
232
        entry = self.inv[self.inv.path2id('symlink')]
239
233
        self.assertEqual(entry.kind, 'symlink')