~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-12 10:44:12 UTC
  • mfrom: (6492.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20120312104412-vm46n41e9kr4xf27
(vila) Merge 2.5 branch (Vincent Ladeuil)

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