~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

  • Committer: Martin Pool
  • Date: 2011-06-14 01:26:41 UTC
  • mto: (6034.2.1 integration)
  • mto: This revision was merged to the branch mainline in revision 6043.
  • Revision ID: mbp@canonical.com-20110614012641-dnb69zb57ae5je4w
Move all test features into bzrlib.tests.features

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
from bzrlib.merge import Merge3Merger, Merger
63
63
from bzrlib.tests import (
64
64
    features,
 
65
    TestCaseInTempDir,
 
66
    TestSkipped,
 
67
    )
 
68
from bzrlib.tests.features import (
65
69
    HardlinkFeature,
66
70
    SymlinkFeature,
67
 
    TestCaseInTempDir,
68
 
    TestSkipped,
69
 
)
 
71
    )
70
72
from bzrlib.transform import (
71
73
    build_tree,
72
74
    create_from_tree,
717
719
                            'wizard2', 'behind_curtain')
718
720
 
719
721
    def test_symlinks_unicode(self):
720
 
        self.requireFeature(tests.UnicodeFilenameFeature)
 
722
        self.requireFeature(features.UnicodeFilenameFeature)
721
723
        self._test_symlinks(u'\N{Euro Sign}wizard',
722
724
                            u'wizard-targ\N{Euro Sign}t',
723
725
                            u'\N{Euro Sign}wizard2',
2162
2164
        self.assertEqualStat(source_stat, target_stat)
2163
2165
 
2164
2166
    def test_case_insensitive_build_tree_inventory(self):
2165
 
        if (tests.CaseInsensitiveFilesystemFeature.available()
2166
 
            or tests.CaseInsCasePresFilenameFeature.available()):
 
2167
        if (features.CaseInsensitiveFilesystemFeature.available()
 
2168
            or features.CaseInsCasePresFilenameFeature.available()):
2167
2169
            raise tests.UnavailableFeature('Fully case sensitive filesystem')
2168
2170
        source = self.make_branch_and_tree('source')
2169
2171
        self.build_tree(['source/file', 'source/FILE'])
3282
3284
        self.assertEqual('contents', rev2_tree.get_file_text('file_id'))
3283
3285
 
3284
3286
    def test_ascii_limbo_paths(self):
3285
 
        self.requireFeature(tests.UnicodeFilenameFeature)
 
3287
        self.requireFeature(features.UnicodeFilenameFeature)
3286
3288
        branch = self.make_branch('any')
3287
3289
        tree = branch.repository.revision_tree(_mod_revision.NULL_REVISION)
3288
3290
        tt = TransformPreview(tree)
3305
3307
 
3306
3308
class TestSerializeTransform(tests.TestCaseWithTransport):
3307
3309
 
3308
 
    _test_needs_features = [tests.UnicodeFilenameFeature]
 
3310
    _test_needs_features = [features.UnicodeFilenameFeature]
3309
3311
 
3310
3312
    def get_preview(self, tree=None):
3311
3313
        if tree is None:
3386
3388
        return self.make_records(attribs, contents)
3387
3389
 
3388
3390
    def test_serialize_symlink_creation(self):
3389
 
        self.requireFeature(tests.SymlinkFeature)
 
3391
        self.requireFeature(features.SymlinkFeature)
3390
3392
        tt = self.get_preview()
3391
3393
        tt.new_symlink(u'foo\u1234', tt.root, u'bar\u1234')
3392
3394
        self.assertSerializesTo(self.symlink_creation_records(), tt)
3393
3395
 
3394
3396
    def test_deserialize_symlink_creation(self):
3395
 
        self.requireFeature(tests.SymlinkFeature)
 
3397
        self.requireFeature(features.SymlinkFeature)
3396
3398
        tt = self.get_preview()
3397
3399
        tt.deserialize(iter(self.symlink_creation_records()))
3398
3400
        abspath = tt._limbo_name('new-1')