~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2008-05-02 02:31:14 UTC
  • mfrom: (3399 +trunk)
  • mto: (3408.1.1 doc)
  • mto: This revision was merged to the branch mainline in revision 3409.
  • Revision ID: mbp@sourcefrog.net-20080502023114-y2gcg3w3jc770j9m
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2006, 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
45
45
    WorkingTreeTestProviderAdapter,
46
46
    )
47
47
from bzrlib.revisiontree import RevisionTree
 
48
from bzrlib.transform import TransformPreview
48
49
from bzrlib.workingtree import (
49
50
    WorkingTreeFormat,
50
51
    WorkingTreeFormat3,
72
73
    return tree.basis_tree()
73
74
 
74
75
 
 
76
def preview_tree_pre(testcase, tree):
 
77
    tt = TransformPreview(tree)
 
78
    testcase.addCleanup(tt.finalize)
 
79
    return tt.get_preview_tree()
 
80
 
 
81
 
75
82
class TestTreeImplementationSupport(TestCaseWithTransport):
76
83
 
77
84
    def test_revision_tree_from_workingtree(self):
314
321
        self.scenarios.append(self.create_tree_scenario(
315
322
            DirStateRevisionTree.__name__, _dirstate_tree_from_workingtree,
316
323
            WorkingTreeFormat4()))
 
324
        self.scenarios.append(self.create_tree_scenario('PreviewTree',
 
325
            preview_tree_pre))
317
326
 
318
327
    def create_tree_scenario(self, name, converter, workingtree_format=None):
319
328
        """Create a scenario for the specified converter