~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/test_link_tree.py

  • Committer: Aaron Bentley
  • Date: 2014-01-13 00:50:22 UTC
  • Revision ID: aaron@aaronbentley.com-20140113005022-q40nvybtox1mt19o
Tags: release-2.6.0
Update for release 2.6.0

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, HardlinkFeature
21
 
 
 
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
22
28
from bzrlib.plugins.bzrtools.link_tree import link_tree
23
29
 
24
30
 
73
79
 
74
80
    def test_link_tree(self):
75
81
        """Ensure the command works as intended"""
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()
 
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