~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_mergetools.py

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

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