~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/test_link_tree.py

  • Committer: Aaron Bentley
  • Date: 2008-11-05 00:21:17 UTC
  • mto: This revision was merged to the branch mainline in revision 678.
  • Revision ID: aaron@aaronbentley.com-20081105002117-ly7injhr5uacyl9s
More cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import os
18
18
 
19
19
from bzrlib.transform import TreeTransform
20
 
from bzrlib.tests import TestCaseWithTransport
21
 
 
22
 
try:
23
 
    from bzrlib.tests.features import HardlinkFeature
24
 
except ImportError: # bzr < 2.5
25
 
    from bzrlib.tests import HardlinkFeature
26
 
 
27
 
from bzrlib.plugins.bzrtools import command
 
20
from bzrlib.tests import TestCaseWithTransport, HardlinkFeature
 
21
 
28
22
from bzrlib.plugins.bzrtools.link_tree import link_tree
29
23
 
30
24
 
79
73
 
80
74
    def test_link_tree(self):
81
75
        """Ensure the command works as intended"""
82
 
        command._testing = True
83
 
        try:
84
 
            os.chdir('child')
85
 
            self.parent_tree.unlock()
86
 
            self.run_bzr('link-tree ../parent')
87
 
            self.assertTrue(self.hardlinked())
88
 
            # want teh addCleanup to work properly
89
 
            self.parent_tree.lock_write()
90
 
        finally:
91
 
            command._testing = False
 
76
        os.chdir('child')
 
77
        self.parent_tree.unlock()
 
78
        self.run_bzr('link-tree ../parent')
 
79
        self.assertTrue(self.hardlinked())
 
80
        # want teh addCleanup to work properly
 
81
        self.parent_tree.lock_write()