~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_selftest.py

  • Committer: Andrew Bennetts
  • Date: 2006-09-15 01:56:04 UTC
  • mto: (1910.19.10 add get_smart_client)
  • mto: This revision was merged to the branch mainline in revision 2012.
  • Revision ID: andrew.bennetts@canonical.com-20060915015604-7a2c896892577c63
Refactor run_bzr_subprocess to use start_bzr_subprocess and finish_bzr_subprocess.

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
        """We can start and perform other test actions while that process is
249
249
        still alive.
250
250
        """
251
 
        process = self.start_bzr_subprocess('--version')
 
251
        process = self.start_bzr_subprocess(['--version'])
252
252
        result = self.finish_bzr_subprocess(process)
253
253
        self.assertContainsRe(result[0], 'is free software')
254
254
        self.assertEqual('', result[1])
256
256
    def test_start_and_stop_bzr_subprocess_with_error(self):
257
257
        """finish_bzr_subprocess allows specification of the desired exit code.
258
258
        """
259
 
        process = self.start_bzr_subprocess('--versionn')
 
259
        process = self.start_bzr_subprocess(['--versionn'])
260
260
        result = self.finish_bzr_subprocess(process, retcode=3)
261
261
        self.assertEqual('', result[0])
262
262
        self.assertContainsRe(result[1], 'unknown command')
263
263
 
264
264
    def test_start_and_stop_bzr_subprocess_ignoring_retcode(self):
265
265
        """finish_bzr_subprocess allows the exit code to be ignored."""
266
 
        process = self.start_bzr_subprocess('--versionn')
 
266
        process = self.start_bzr_subprocess(['--versionn'])
267
267
        result = self.finish_bzr_subprocess(process, retcode=None)
268
268
        self.assertEqual('', result[0])
269
269
        self.assertContainsRe(result[1], 'unknown command')
272
272
        """finish_bzr_subprocess raises self.failureException if the retcode is
273
273
        not the expected one.
274
274
        """
275
 
        process = self.start_bzr_subprocess('--versionn')
 
275
        process = self.start_bzr_subprocess(['--versionn'])
276
276
        self.assertRaises(self.failureException, self.finish_bzr_subprocess,
277
277
                          process, retcode=0)
278
278
        
280
280
        """finish_bzr_subprocess raises self.failureException if the retcode is
281
281
        not the expected one.
282
282
        """
283
 
        process = self.start_bzr_subprocess('wait-until-signalled')
 
283
        process = self.start_bzr_subprocess(['wait-until-signalled'])
284
284
        self.assertEqual('running\n', process.stdout.readline())
285
285
        result = self.finish_bzr_subprocess(process, send_signal=signal.SIGINT,
286
286
                                            retcode=3)