~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2010-02-18 05:38:14 UTC
  • mfrom: (4634.132.2 2.0)
  • mto: (4634.134.1 2.0)
  • mto: This revision was merged to the branch mainline in revision 5069.
  • Revision ID: mbp@sourcefrog.net-20100218053814-fw8opjs6acp5lvs0
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2007, 2008, 2010 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
23
23
from bzrlib import (
24
24
    tests,
25
25
    )
26
 
from bzrlib.tests import per_tree
 
26
from bzrlib.tests import (
 
27
    features,
 
28
    per_tree,
 
29
    )
27
30
from bzrlib.mutabletree import MutableTree
28
31
from bzrlib.tests import SymlinkFeature, TestSkipped
29
32
from bzrlib.transform import _PreviewTree
131
134
        work_tree.add(['dir', 'dir/file'])
132
135
        if commit:
133
136
            work_tree.commit('commit 1')
 
137
        # XXX: this isn't actually guaranteed to return the class we want to
 
138
        # test -- mbp 2010-02-12
134
139
        return work_tree
135
140
 
136
141
    def test_canonical_path(self):
163
168
        work_tree = self._make_canonical_test_tree()
164
169
        self.assertEqual('dir/None',
165
170
                         work_tree.get_canonical_inventory_path('Dir/None'))
 
171
 
 
172
    def test_canonical_tree_name_mismatch(self):
 
173
        # see <https://bugs.edge.launchpad.net/bzr/+bug/368931>
 
174
        # some of the trees we want to use can only exist on a disk, not in
 
175
        # memory - therefore we can only test this if the filesystem is
 
176
        # case-sensitive.
 
177
        self.requireFeature(tests.case_sensitive_filesystem_feature)
 
178
        work_tree = self.make_branch_and_tree('.')
 
179
        self.build_tree(['test/', 'test/file', 'Test'])
 
180
        work_tree.add(['test/', 'test/file', 'Test'])
 
181
 
 
182
        test_tree = self._convert_tree(work_tree)
 
183
        test_tree.lock_read()
 
184
        self.addCleanup(test_tree.unlock)
 
185
 
 
186
        self.assertEqual(['test', 'test/file', 'Test', 'test/foo', 'Test/foo'],
 
187
            test_tree.get_canonical_inventory_paths(
 
188
                ['test', 'test/file', 'Test', 'test/foo', 'Test/foo']))