~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007, 2008 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 (
27
 
    features,
28
 
    per_tree,
29
 
    )
 
26
from bzrlib.tests import per_tree
30
27
from bzrlib.mutabletree import MutableTree
31
28
from bzrlib.tests import SymlinkFeature, TestSkipped
32
29
from bzrlib.transform import _PreviewTree
134
131
        work_tree.add(['dir', 'dir/file'])
135
132
        if commit:
136
133
            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
139
134
        return work_tree
140
135
 
141
136
    def test_canonical_path(self):
168
163
        work_tree = self._make_canonical_test_tree()
169
164
        self.assertEqual('dir/None',
170
165
                         work_tree.get_canonical_inventory_path('Dir/None'))
171
 
 
172
 
    def test_canonical_tree_name_mismatch(self):
173
 
        # see <https://bugs.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']))