~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_mergetools.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-30 01:33:38 UTC
  • mfrom: (6511.2.2 fix-serve-test)
  • Revision ID: pqm@pqm.ubuntu.com-20120330013338-d3vspfdtj6dvnc0c
(jelmer) Consistently use 127.0.0.1 for setting up a blackbox server and
 connecting to it. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
import os
18
 
import re
19
18
import sys
20
19
import tempfile
21
20
 
23
22
    mergetools,
24
23
    tests
25
24
)
26
 
from bzrlib.tests.features import backslashdir_feature
27
25
 
28
26
 
29
27
class TestFilenameSubstitution(tests.TestCaseInTempDir):
39
37
             '-o',
40
38
             'test.txt'],
41
39
            args)
42
 
        
 
40
 
43
41
    def test_spaces(self):
44
42
        cmd_list = ['kdiff3', '{base}', '{this}', '{other}', '-o', '{result}']
45
43
        args, tmpfile = mergetools._subst_filename(cmd_list,
107
105
            ('test.txt.THIS', 'this stuff'),
108
106
            ('test.txt.OTHER', 'other stuff'),
109
107
        ))
110
 
        
 
108
 
111
109
    def test_invoke_expands_exe_path(self):
112
110
        self.overrideEnv('PATH', os.path.dirname(sys.executable))
113
111
        def dummy_invoker(exe, args, cleanup):
120
118
        self.assertEqual(0, retcode)
121
119
        self.assertEqual(sys.executable, self._exe)
122
120
        self.assertEqual(['test.txt'], self._args)
123
 
        
 
121
 
124
122
    def test_success(self):
125
123
        def dummy_invoker(exe, args, cleanup):
126
124
            self._exe = exe
131
129
        self.assertEqual(0, retcode)
132
130
        self.assertEqual('tool', self._exe)
133
131
        self.assertEqual(['test.txt'], self._args)
134
 
    
 
132
 
135
133
    def test_failure(self):
136
134
        def dummy_invoker(exe, args, cleanup):
137
135
            self._exe = exe
159
157
        self.assertEqual('tool', self._exe)
160
158
        self.assertPathDoesNotExist(self._args[0])
161
159
        self.assertFileEqual('temp stuff', 'test.txt')
162
 
    
 
160
 
163
161
    def test_failure_tempfile(self):
164
162
        def dummy_invoker(exe, args, cleanup):
165
163
            self._exe = exe