/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 bzrlib/tests/tree_implementations/test_get_symlink_target.py

  • Committer: Martin Pool
  • Date: 2009-06-10 02:51:23 UTC
  • mfrom: (4423 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4464.
  • Revision ID: mbp@sourcefrog.net-20090610025123-2u0c0ng5jcezjzqh
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Test that all Tree's implement get_symlink_target"""
18
18
 
23
23
    osutils,
24
24
    tests,
25
25
    )
26
 
from bzrlib.tests.tree_implementations import TestCaseWithTree
27
 
 
28
 
 
29
 
class TestGetSymlinkTarget(TestCaseWithTree):
 
26
from bzrlib.tests import tree_implementations
 
27
 
 
28
 
 
29
class TestGetSymlinkTarget(tree_implementations.TestCaseWithTree):
30
30
 
31
31
    def get_tree_with_symlinks(self):
32
32
        self.requireFeature(tests.SymlinkFeature)
49
49
 
50
50
    def test_get_unicode_symlink_target(self):
51
51
        self.requireFeature(tests.SymlinkFeature)
 
52
        self.requireFeature(tests.UnicodeFilenameFeature)
52
53
        tree = self.make_branch_and_tree('tree')
53
 
        try:
54
 
            os.symlink('target',  u'tree/\u03b2_link'.encode(osutils._fs_enc))
55
 
        except UnicodeError:
56
 
            raise tests.TestSkipped(
57
 
                'This platform does not support unicode file paths.')
58
 
        tree.add([u'\u03b2_link'], ['unicode-link-id'])
 
54
        target = u'targ\N{Euro Sign}t'
 
55
        os.symlink(target,  u'tree/\u03b2_link'.encode(osutils._fs_enc))
 
56
        tree.add([u'\u03b2_link'], ['link-id'])
59
57
        tree.lock_read()
60
58
        self.addCleanup(tree.unlock)
61
 
        self.assertEqual('target', tree.get_symlink_target(u'unicode-link-id'))
 
59
        actual = tree.get_symlink_target('link-id')
 
60
        self.assertEqual(target, actual)
62
61