~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_mergetools.py

  • Committer: Vincent Ladeuil
  • Date: 2012-03-13 17:25:29 UTC
  • mfrom: (6499 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6501.
  • Revision ID: v.ladeuil+lp@free.fr-20120313172529-i0suyjnepsor25i7
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
        self.assertTrue(mergetools.check_availability(sys.executable))
82
82
 
83
83
    def test_exe_on_path(self):
84
 
        if sys.platform == 'win32':
85
 
            exe = 'cmd.exe'
86
 
        else:
87
 
            exe = 'sh'
88
 
        self.assertTrue(mergetools.check_availability(exe))
 
84
        self.assertTrue(mergetools.check_availability('python'))
89
85
 
90
86
    def test_nonexistent(self):
91
87
        self.assertFalse(mergetools.check_availability('DOES NOT EXIST'))
112
108
            ('test.txt.OTHER', 'other stuff'),
113
109
        ))
114
110
        
 
111
    def test_invoke_expands_exe_path(self):
 
112
        self.overrideEnv('PATH', os.path.dirname(sys.executable))
 
113
        def dummy_invoker(exe, args, cleanup):
 
114
            self._exe = exe
 
115
            self._args = args
 
116
            cleanup(0)
 
117
            return 0
 
118
        command = '%s {result}' % os.path.basename(sys.executable)
 
119
        retcode = mergetools.invoke(command, 'test.txt', dummy_invoker)
 
120
        self.assertEqual(0, retcode)
 
121
        self.assertEqual(sys.executable, self._exe)
 
122
        self.assertEqual(['test.txt'], self._args)
 
123
        
115
124
    def test_success(self):
116
125
        def dummy_invoker(exe, args, cleanup):
117
126
            self._exe = exe